jwhitley / requirejs-rails

RequireJS support for your Rails 3 or 4 application
MIT License
592 stars 202 forks source link

Add wrapShim to build_config_whitelist #273

Closed wuservices closed 6 years ago

wuservices commented 6 years ago

Allows using wrapShim in the build config (introduced in 2.1.11)

See: https://github.com/requirejs/r.js/blob/b8a6982d2923ae8389355edaa50d2b7f8065a01a/build/example.build.js#L68

As of 2.1.11, shimmed dependencies can be wrapped in a define() wrapper to help when intermediate dependencies are AMD have dependencies of their own. The canonical example is a project using Backbone, which depends on jQuery and Underscore. Shimmed dependencies that want Backbone available immediately will not see it in a build, since AMD compatible versions of Backbone will not execute the define() function until dependencies are ready. By wrapping those shimmed dependencies, this can be avoided, but it could introduce other errors if those shimmed dependencies use the global scope in weird ways, so it is not the default behavior to wrap. More notes in http://requirejs.org/docs/api.html#config-shim

carsomyr commented 6 years ago

@wuservices Thanks!

mrgordon commented 6 years ago

@carsomyr Would you mind adding a tag or pushing a new release to GitHub with this change?

carsomyr commented 6 years ago

@mrgordon Yeah, thanks for reminding me.

marat-ad commented 6 years ago

@carsomyr Can you please push that release?

carsomyr commented 6 years ago

Try now?