handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.82k stars 2.04k forks source link

Request to support babel 6 #1386

Open pravi opened 6 years ago

pravi commented 6 years ago

We'd like to use babel 6 to build handlebars in debian. Currently build fails with this error

Warning: [BABEL] lib/handlebars.js: Using removed Babel 5 option: base.loose - Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option. Use --force to continue.
nknapp commented 6 years ago

There is a work-in-progress PR at #1271. If you want to pick it up and finish it, you are welcome.

nknapp commented 6 years ago

Whoever gets working on this, please make an PR against the 4.x-branch, because the master will not be release in the near future.

nknapp commented 6 years ago

I've made an attempt in the branch "babel6". The webpack-configuration is still missing, and I'm not sure this works with webpack 1.x. Maybe it needs to be upgraded as well, but I don't know if I have the time for that now.

If anyone wants to pick this up (on my branch or on #1271, go ahead).

nknapp commented 6 years ago

If anyone feels inclined to work on this problem, please check out the branch 4.x-babel6 and create PRs to this branch.

nknapp commented 6 years ago

@pravi I don't fully understand why you can't use babel5 to compile handlebars. Do you have to use the version that comes packaged with debian?

This update is harder than it looks because there the breaking changes in the module loading behavior in babel@6 (see the discussion at #1402 and the changelog at https://github.com/babel/babel/blob/master/CHANGELOG.md#600

The changes look valid and they are actually bugfixes, but they are not backward compatible and cause the handlebars-tests to fail.

This can only be pushed into Handlebars 4.x, if

Otherwise this would have to be Handlebars@5 and I don't see that happen, unless sombody starts working on a formal specification of the language (#1277).

As fas a I'm concerned. I am currently not working on this issue, but I will look into pull-requests and discussions.

pravi commented 6 years ago

@nknapp yes, I have to use the version packaged in debian, which is babel 6. Usually I can manage to update to a newer version (like if handlebars used babel@7, I can update babel in debian to 7, but moving to old versions are practically discouraged, but possible only in extreme cases. This also means maintaining multiple versions of babel, which we always try to avoid.)

pravi commented 6 years ago

@nknapp have a look at #1416 it fixes both babel 6 and webpack 3 issues.

nknapp commented 6 years ago

I have seen it, but I haven't had time for a closer look. I'm kind of busy at the moment. But I will look into it...

nknapp commented 4 years ago

For 5.0, we should update all dependencies to recent versions, including babel and webpack.

In some version of babel, the behaviour of default exports and wildcard imports was changed (to match the specified behaviour of ES6) which breaks the way Handlebars uses this behaviour.

We will do this without a spec now, because it does not affect the Handlebars language itself.