Skip to content

Added UMD wrapper for bootstrap-decorator #495

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

Merged
merged 5 commits into from
Aug 14, 2015

Conversation

angelaharalson
Copy link
Contributor

Fixes this issue:
RequireJs wrapper for bootstrap-decorator #435

@nicklasb
Copy link
Member

nicklasb commented Aug 1, 2015

Interesting, I just made this PR:
#493

:-)

@nicklasb
Copy link
Member

nicklasb commented Aug 1, 2015

I realized that this is way better than my PR, as it should require() everything properly.

@nicklasb
Copy link
Member

nicklasb commented Aug 1, 2015

While going on with packaging and modules, I should mention that I just added ASF and some of the most used(?) ASF add-ons to the jspm registry:
jspm/registry#510

(BTW, this PR will render the 0.8.4 main-override of ASF unnecessary)

@davidlgj
Copy link
Contributor

@angelaharalson awesome! I don't use RequireJS so I really appreciate help with this. Can I trouble you to redo the PR without the minified files in dist?

@davidlgj davidlgj merged commit e8ca011 into json-schema-form:development Aug 14, 2015
@davidlgj
Copy link
Contributor

@angelaharalson I merged it manually since I want to migrate the decorator to it's own repo. Thanks!

@nicklasb
Copy link
Member

Hi, this seems to be a problem with PR, I am however not sure what is the correct solution.
The problem is, that if one is using a module loading framework like SystemJS/JSPM or RequireJS, a dependency is on the "angular-schema-form"-form, as it is typically referring to a npm/bower/jspm registration (and as you usually don't deviate from the naming, simply because one doesn't have to), it doesn't work.

This PR sets it to "schemaForm" for all situations, which does not work with those kinds of frameworks.

To make the add-on I am maintaining, angular-schema-form-dynamic-select work with my "MBE-frontend" which uses SystemJS/JSPM and the names are automagically generated, I have to set the amd and cjs options for the require-section. This way, loading bootstrap-decorator.js correctly causes angular-schema-form.js to load.

However, I am not completely sure about all of this, UMD and ES6 modules and their naming conventions and when what is used is a bit hard to understand and not always clear. So if someone more knowledgeable than me could chime in here would be great.

@nicklasb
Copy link
Member

@angelaharalson, @davidlgj : I feel pretty sure that the correct solution is:

            dependencies: function() {
              return [
                {name: 'schemaForm',
                amd:"angular-schema-form",
                cjs: 'angular-schema-form'},
              ];

@nicklasb
Copy link
Member

Aaand now something seems to be strange in gulp-umd. I created an issue there, I'll be back.
eduardolundgren/gulp-umd#17

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

Successfully merging this pull request may close these issues.

3 participants