-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing functionnality allowing env to pass a template engine
Rationale: Template engine are only related to the generator itself. The environment shouldn't have any control on it (it just doesn't make sense)
- Loading branch information
Showing
3 changed files
with
3 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
566ab33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SBoudrias is there a way to configure the engine from a generator? I don't see how to support a handlebars-engine with v0.18.
566ab33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly works:
But each engine would need to wire up its own
engine.detect
check. Recommended for now?566ab33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all: you never could exactly define a different engine. It never worked (maybe under some circumstances, but in most cases it would just broke). This commit only removed code that wasn't working correctly.
Second, here's my take on it. Generators are usually fairly simple. They're not complex web apps. As so, I hardly see the need to define a different templating engine. Lodash templates are not great, but they're good enough for our use cases (and the most flexible).
On the practical side, you can define custom delimiters on the template methods. So you can prevent conflict with the template delimiters symbols.
And on the other side, we're moving away from the monolithics utilities, and we're moving away from
this.template
andthis.copy
, etc (these legacy methods are the only ones still usingthis.engine
, and they'll stop doing so in a planned future release - see our deprecation plan). You can learn about our new file utilities on the version 0.18 release notes.Hope this helps understanding where we're going with
yeoman-generator
. Feel free to open a new issue to discuss re-allowing custom engines if you feel strongly about this feature.566ab33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. Thanks for clearing things up. I don't feel strongly about custom engines. Glad to hear the core is getting smaller 🌞