-
Notifications
You must be signed in to change notification settings - Fork 4.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
UMD #2215
Comments
What is wrong with a shim for Chosen? Not that I would be against a wrapper, but is there any real use to it? {
// ...
shim: {
chosen: {
deps: ['jquery']
}
}
// ...
} |
UMD makes it easier for developers to consume your library. Your quote from Jeremy is 2.5 years old, and his two most popular libraries continue to ship UMD to this day. |
👍 To this. UMD reduces configuration for developers using module loaders, encourages modern practices and adds a minimal amount of extra code (that you can add as a build step if you like). |
+1 UMD simplifies using of the library in the most cases. Chosen should not force developers to use browser's globals. |
What is the status of this request? Is it under consideration or in progress? |
Nobody is working on this among maintainers. However, I think that this request is legitimate. So I welcome contributions if someone wants to work on this. |
Sorry for the tardy response. I don't have much spare time at the moment. But if I find any, I'll create a PR. |
Supersedes #2065 and #1433
The built version of Chosen only works with browser globals. Browser globals are falling out of fashion in favor of using module loaders, like AMD or CJS. Unfortunately, it's a bit of a pain for developers using those systems to integrate Chosen into them.
You can support the most common use cases of Chosen with a (fairly ugly) wrapper. Chosen's wrapper looks like this.
There's no question that it really sucks to include the wrapper, because it's added source code, but some folks feel that the benefits outweigh the cons. Some of the benefits are:
Applying the wrapper can be easily done with an extra grunt task. I usually use
grunt-preprocessor
to wrap my files. I can make the PR if you wish.If you add the wrapper, I would suggest that you add the repo to npm. Then, you could run
npm publish
after you've built the library to be distributed as a zip file, and the npm version would get the updated build.whatcha think ❓
The text was updated successfully, but these errors were encountered: