-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix dev code for webpack compatibility #346
Conversation
@matthewp @justinbmeyer is this can be merged? |
can-define.js
Outdated
// If value is a constructor, give a warning | ||
if (definition.default && canReflect.isConstructorLike(definition.default)) { | ||
canLogDev.warn("can-define: The \"default\" for " + prop + " is set to a constructor. Did you mean \"Default\" instead?"); | ||
if(process.env.NODE_ENV !== 'production') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an indentation problem here.
list/list.js
Outdated
@@ -590,44 +599,46 @@ var DefineList = Construct.extend("DefineList", | |||
// pass `key` to only log the matching event, e.g: `list.log("add")` | |||
log: function(key) { | |||
//!steal-remove-start | |||
var instance = this; | |||
if(process.env.NODE_ENV !== 'production') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might it have been easier to have log be a no-op here and at the bottom of this file:
//!steal-remove...
if(process.env...){
DefineList.prototype.log = function(){ ... }
}
//!steal-remove..
map/map.js
Outdated
var quoteString = function quoteString(x) { | ||
return typeof x === "string" ? JSON.stringify(x) : x; | ||
}; | ||
if(process.env.NODE_ENV !== 'production') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about log from above. Btw, could log
be shared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could be shared even if they don't share the same event types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log is shared now.
@justinbmeyer |
the ensure_meta should probably be put in define_helpers too. I think we should avoid creating modules unnecessarily. It adds to the loadtime. |
@justinbmeyer Can we handle ensure_meta in other PR? |
Yes. We can do it later.
…Sent from my iPhone
On Jul 3, 2018, at 4:32 PM, Mohamed Cherif Bouchelaghem ***@***.***> wrote:
@justinbmeyer Can we handle ensure_meta in other PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This fixes the first part of this issue canjs/canjs#4170 to remove debug code from the production builds.