This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Split Handlebars into multiple packages #1585
Labels
Milestone
You can continue the conversation there. Go to discussion →
@wycats and me discussed this a couple of weeks ago:
The ember project is currently using the Handlebars parse to generate an AST, but it is using an older version (I believe version 3). Version 4 has some features that aren't needed by ember and won't be needed.
By extracting the parser from the main project, we would reach several goals.
ember
and Handlebars). We would probably integrate some of the newer Ember features like components as well.not have some of the features (like inline-partials). Those features are still to be defined (we need a spec).
jison
very hard to work with, especially since I have found no IDE integrations for.yy
and.l
files.What I was thinking about now is: Extract not only the parser, but only the precompiler into its own package.
We could have the following npm-packages:
@handlebars/parser
- to include the parser@handlebars/compiler
- to include the javascript-compiler@handlebars/runtime
- to include the runtimehandlebars
- the current package, which uses them all (and binds them). The main goal of thispackage should be to maintain backwards-compatibility, but use the extracted packages to
avoid duplicate code.
I am not sure if it is a good idea to extract
compiler
andruntime
into separate packages though.The source of new packages could be moved to the
handlebars-lang
org on github.Any opinions on this?
How do we get there?
Starting with the parser, I was thinking about setting up a new repo in the
handlebars-lang
-org. I would like to start fresh, with modern tools (current webpack and babel versions, prettier for formatting, eslint only for linting, possibly jest or "mocha/chai", possibly semantic-release.The we should look at the current tests and see if we cannot transform them into a language independent form like
This would other people allow to build a compatible parser as well (in other languages)
The text was updated successfully, but these errors were encountered: