Skip to content
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

Do not use script-wide use strict statement #49

Closed
dekr opened this issue Apr 13, 2015 · 10 comments
Closed

Do not use script-wide use strict statement #49

dekr opened this issue Apr 13, 2015 · 10 comments
Labels

Comments

@dekr
Copy link

dekr commented Apr 13, 2015

You are using a script-wide form of use strict statement. This may cause problems with minimizing. You can use a function form instead:

(function(document, window, ...) {
    "use strict";
})(document, window, ...);

There is more explanation on the following stackoverflow-thread: stackoverflow link

@kenwheeler
Copy link
Collaborator

thanks, looking into this

@shshaw
Copy link
Collaborator

shshaw commented Apr 12, 2016

That seems to be automatically added by one of the preprocessors as it isn't present in the actual _wrapper.js file. I am trying to track down which one is doing it, and I think 6to5 is likely the culprit. Since 6to5 is now Babel, it may be worthwhile to migrate over to Babel to get the latest updates.

@shshaw shshaw mentioned this issue Apr 13, 2016
3 tasks
@shshaw shshaw added the bug label Apr 13, 2016
@shshaw shshaw mentioned this issue Apr 13, 2016
@thasmo
Copy link

thasmo commented Aug 5, 2016

@shshaw This is somewhat of a big issue. I've problems with including different libraries when they're included after Cash. If I include those libraries before Cash everything works. Wondering that not more people have found this issue. For now I can only include Cash as the last script.

@shshaw
Copy link
Collaborator

shshaw commented Aug 8, 2016

Yeah, I want to fix this as well.

It's tied into #93 ( and #90 / #92 ), which is a big change to the build process. @simeydotme was helping with this, but I'm not sure if he's made any more progress. If you have Babel experience or can help with the build process, then please contribute.

@thasmo
Copy link

thasmo commented Aug 8, 2016

Unfortunately I don't have experience with Babel nor 6to5.

@shshaw
Copy link
Collaborator

shshaw commented Aug 8, 2016

Unfortunately I don't either 😄 I've stumbled around with it a bit, but their documentation is quite cryptic, so I haven't wanted to deploy anything without someone experienced taking a look.

@shshaw
Copy link
Collaborator

shshaw commented Oct 12, 2016

Took another stab at this, and managed a gulp-free build process using babel and uglify.

Pushed to the build-revision branch. Please try it out and let me know if you find any issues.

@rcoelho
Copy link

rcoelho commented Feb 4, 2017

Works for me!
Thanks for preparing this build, it took me some time to land here; when I did, problem solved :)

@fabiospampinato fabiospampinato added this to the v2.2.0 milestone May 11, 2018
@fabiospampinato
Copy link
Owner

This will be addressed in the next milestone.

@fabiospampinato
Copy link
Owner

Fixed in v2.1.3.

It was surprisingly tricky to implement, the minifiers kind of got in the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants