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

Support AMD and CommonJS out of the box #537

Merged
merged 1 commit into from
May 31, 2013

Conversation

spikebrehm
Copy link
Contributor

This add support for both AMD and CommonJS, falling back to typical browser behavior. This is very similar to #501, but a bit cleaner. This also obviates #500 and #509.

It would be awesome to support these module loaders out of the box, preventing developers from using forks to support their projects (as I have had to do). Browserify does enable the use of Handlebars + CommonJS in the client side, but only with a fancy AST-walk in a build step; it makes sense to allow CommonJS without a fancy build step.

Specs are passing:

Finished in 0.24254 seconds
202 examples, 0 failures

> handlebars@1.0.11 test /Users/spike/code/spikebrehm/handlebars.js
> node_modules/.bin/mocha -u qunit spec/qunit_spec.js


  ․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
  ․․․․․․․․․․․․․․․․․․․․

  134 tests complete (121 ms)

@kpdecker
Copy link
Collaborator

This is something that we will likely do in the 1.1 timeframe. I'm a bit hesitant to release this for the first time in the 1.0 final release.

kpdecker added a commit that referenced this pull request May 31, 2013
Support AMD and CommonJS out of the box
@kpdecker kpdecker merged commit caded1d into handlebars-lang:master May 31, 2013
@spikebrehm spikebrehm deleted the support-all-the-modules branch May 31, 2013 19:59
@spikebrehm
Copy link
Contributor Author

Thanks @kpdecker! Would it be possible to publish a 1.0.13 NPM module that includes this change?

@kpdecker
Copy link
Collaborator

I hope to have a 1.1.0-alpha.01 by the end of the weekend. This should also
unify the version numbers problem that we have been having.

On Fri, May 31, 2013 at 4:11 PM, Spike Brehm notifications@gitpro.ttaallkk.topwrote:

Thanks @kpdecker https://github.com/kpdecker! Would it be possible to
publish a 1.0.13 NPM module that includes this change?


Reply to this email directly or view it on GitHubhttps://github.com//pull/537#issuecomment-18768831
.

@spikebrehm
Copy link
Contributor Author

Any news on a 1.1.0-alpha.01, or even a 1.0.13? Thanks!

@spikebrehm
Copy link
Contributor Author

ping

@kpdecker
Copy link
Collaborator

@spikebrehm I've been holding off on a formal release of the current CommonJS code (it is available in master) as I'm waiting to see where @wycats work noted above goes. They both solve the same problem but in very different ways.

Basically I'd like to avoid flip flopping on the recommended behavior even if it's done in a alpha release.

@spikebrehm
Copy link
Contributor Author

Got it, thanks for the response. In the meantime, I'm just working off a
fork that includes the CommonJS commit.

On Sun, Jul 14, 2013 at 1:32 PM, Kevin Decker notifications@gitpro.ttaallkk.topwrote:

@spikebrehm https://github.com/spikebrehm I've been holding off on a
formal release of the current CommonJS code (it is available in master) as
I'm waiting to see where @wycats https://github.com/wycats work noted
above goes. They both solve the same problem but in very different ways.

Basically I'd like to avoid flip flopping on the recommended behavior even
if it's done in a alpha release.


Reply to this email directly or view it on GitHubhttps://github.com//pull/537#issuecomment-20943219
.

Spike Brehm
Software Engineer
www.airbnb.com

San Francisco, CA, USA
C: (602) 828-2358
See how Airbnb works https://www.airbnb.com/info/how_it_works

@wycats
Copy link
Collaborator

wycats commented Jul 14, 2013

I'm back from Australia and now that ES6 Module Transpiler is up to date I should be able to make some progress on mornings this week.

@kpdecker
Copy link
Collaborator

kpdecker commented Nov 4, 2013

Released in 1.1.0

@spikebrehm
Copy link
Contributor Author

Yay! Thanks @kpdecker 🍻

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