Closed saponifi3d closed 10 years ago
@saponifi3d I honestly don't think the upgrade will be very awful, but I'm swamped with work. There's just a handful of AST changes that need to be made. Happy to advise where I can, would love it if you'd take a stab.
I've got some of the changes done, but running into problems getting blocks in general to work. Have any suggestions to speed up development and debugging?
Can you be more specific? Not sure how you're going about it but it all comes down to getting Emblem to generate the same AST as Handlebars, so it might help to have a JSBin like this to play around with: http://jsbin.com/tuzeqedaro/edit?html,js,console,output
And of course, take a look at that handlebars repo to see how it internal creates these AST nodes to replicate it. I know there's some Emblem code which has branching logic to support difference AST versions between minor versions of Handlebars; feel free to get rid of those to keep the code clean (you'll also have to prevent those old test cases from running). I figure once this is in place we can probably launch a 1.0 Emblem that'll be linked to Handlebars 2.0
Okay, cool. I've been trying to keep parity with all versions of Handlebars so that will probably speed me up quite a bit. I've just been basically trying to run the tests to see what's happening and debugging is a pain. I'll tryout the jsbin stuff and stop trying to support Handlebars 1.x thanks!
Hey @machty I've gone through and fixed pretty much everything to do with AST changes. However, I can't seem to get the Ember.js stuff to work.
After a bit of looking it appears that it requires Ember 1.9.0+ (which is still in beta). It looks like Ember is dropping support of Handlebars 1.x as well moving forward - what do you think of using the beta as it stands to move continue to move this forward? (Down to 9 failing tests, 2 for the view helper and 7 for class shorthand and explicit declaration is coalesced
)
@saponifi3d Using the 1.9.0 beta for the tests makes sense to me. Thank you for your continued work!
Hey, I have hit a bit of a wall with the upgrade. I keep getting an error that data.buffer
is undefined when it's trying to add to the buffer for ember. I'm not really familiar with ember, but it seems like the error is stemming from a few different places. The first place is in qunit_spec.coffee
precompileEmber = (emblem) ->
Emblem.precompile(EmberHandlebars, emblem).toString()
It seems like precompile returns a function or object depending on the options passed into it. Once I updated this to call the returned function with the data expected, I started getting the error data.buffer is undefined
. I tracked this down to being in Ember and test/resources/ember-template-compiler.js
where I promptly hit a wall. I'm not sure if I should just kinda rework all of the ember helper or what, but this happens even with the beta version of Ember that only supports Handlebars 2. Any thoughts here would be INCREDIBLY helpful, as I'm pretty stuck at this point.
If you have a minute can you checkout https://github.com/saponifi3d/emblem.js/tree/upgrade-handlebars-2.0.0 and see if anything is flashing any red lights for you?
emblem.js is now a major version behind on handlebars - it seems like there are a lot of little fixes in handlebars that fix a number of issues i've been running into.
Is there any thought of upgrading to use Handlebars 2.0.0? I can take a stab at the upgrade if you want, it seems there are about 40 failing tests if you just upgrade out of the box.