-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Make conform to new UMD specification. #1761
Comments
A pr would be great! It could also be included in 1.6 release planned for the end of the month! But is it backwards compatible with the current implementation? |
Nope, there is no way to make it backwards compat. The old method of UMD did something very, very nasty and should have never been the standard. For Common.js, it included a new version of jQuery for every plugin that used require("module"). Well, that's majorly problematic because every plugin with jQuery is supposed to play well with every other plugin. So it just adds file size and a redundant copy of jQuery. The new version permits you to have one copy of jQuery shared, and each plugin would return an instance of jQuery.. Observe,
Or, even,
You can see the code requiring a new version of jquery here in the bootstrap-datepicker repo.. |
Then again, I don't see you documenting CommonJS inclusion anywhere on this module, but undoubtedly someone is using it somewhere under Browserify or some other CommonJS build system. |
Hmm I was hoping that we could achieve BC in some way! I will take a look at the patch otherwise this has to wait until 2.0. |
I'm going to put my own branch into production then. Please take a look at cherry picking the other changes out (which fix some issues I had with jslint/jscs) for your 1.6x release. And, also perhaps you should fork off a 2.x branch so this PR doesn't get lost? May want to milestone "2.x" this in github. |
I've added the milestone! But I will take a look at the patch in detail one of the days as we can't break BC in 1.x releases but I understand this changes should be adapted soon! |
One other question about the packaging of bootstrap-datepicker. The root package.json in the repository points to I believe this can be remedied by
This would allow those of forking to use our copy in production without having to push up our own dist/. There are other ways we can handle this too, such as forking on the committers side with a copy of dist. But, I think that's kind of sloppy. |
Hmm don't know about that issue! Can you put this issue/description in a seperate issue? I will take a look at it and try to fix it! Thanks for the report! |
I would like to know where this is at, as it is affecting me right now. |
Patch is here, |
The new UMD specification can be found here,
This would change the require code to be required like this in CommonJS
but, it'll add the ability to make rendering work in PhantomJS,
And, it would add the ability to share an instance of jQuery with another module (rather than having multiple instances of jQuery as the current code does). This is a tremendous advantage for Browserify users,
If you'd like I can submit a pull request.
The text was updated successfully, but these errors were encountered: