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

Enable dist files to work with CommonJS AND amd-style/require.js #501

Closed
wants to merge 5 commits into from
Closed

Conversation

HoffmannP
Copy link
Contributor

This PR is a proposition to make handlebars.js even more compatible with library styles. It add's compatibility to the amd-style (require.js) and includes #500 for building compatibility to CommonJS and not polluting global namespace anymore.

…or it might be a sign that making compatible to should find and end somewhere…

@kpdecker
Copy link
Collaborator

We need to make sure that the unit tests are functioning here. It looks like these changes break the ruby context that some of the tests are run under due to the change in the global variable scope.

@alejandroiglesias
Copy link

Any news about integrating this?

@HoffmannP
Copy link
Contributor Author

All right, I'd say someone common to commonJS (pun intended) should add support for that (probably #500) and #509 should be used for AMD/require.js style. I don't see any benefit in trying to do both.
Especially as my try to start a talk about which library-stuff should be included didn't work out. (see also #505 and #489)

@HoffmannP HoffmannP closed this May 4, 2013
if (typeof window === 'object') { window.Handlebars = Handlebars; } else

// node.js
if (typeof global === 'object') { global.Handlebars = Handlebars; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad -- you don't want to force Handlebars to be exposed as a global. Probably this if...else tree should just live in the browser-prefix.js file.

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.

4 participants