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

Allow engines to support multple extensions #623

Closed
3 tasks done
bmuenzenmeyer opened this issue Feb 15, 2017 · 16 comments
Closed
3 tasks done

Allow engines to support multple extensions #623

bmuenzenmeyer opened this issue Feb 15, 2017 · 16 comments

Comments

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Feb 15, 2017

I am using Pattern Lab Node v2 and v3 on Windows, with Node v6.9.5, using the Gulp Edition.

Expected Behavior

PatternEngines that support more than one common file extension for their template type should be forgiving and accomodate user preference. Examples

Actual Behavior
  • Only one type is hard-coded into the engine. This causes problems with watches and the pattern code viewer and is detrimental to user adoption.
@bmuenzenmeyer bmuenzenmeyer added this to the 3.0.0 milestone Feb 15, 2017
@raphaelokon
Copy link
Contributor

Modules and scripts in JS

  • .mjs and .js

@bmuenzenmeyer
Copy link
Member Author

bmuenzenmeyer commented Feb 15, 2017

For which engine would that be? This issue is limited to PatternEngine use cases, not file watches of client-side javascript.

@raphaelokon
Copy link
Contributor

raphaelokon commented Feb 15, 2017

Each engine that is using a Javascript module semantics (ES6 module syntax) in Node ecosystem?

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

With the engines that we currently have, .js would be reserved for React, but we should also think of what kinds of files an Ember or Polymer / Web Components component engine might look for. I don't know those well enough to be able to say. I think Ember does Handlebars, or at least it used to.

@bmuenzenmeyer
Copy link
Member Author

Maybe I am missing something, but my intent for this issue was to alter https://github.com/pattern-lab/patternengine-node-handlebars/blob/master/lib/engine_handlebars.js#L40 to be an array of exentions that make sense for the engine. Not sure how we would handle mixed trees with overlapping capabilities, however.

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

I agree, that's what we're doing. It would get pretty complicated to have a file extension claimed by more than one engine; I don't want to do that unless we really have to.

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

Well, maybe not if mixed trees really are rare. Sorry, I think I'm too much in that mentality. We don't even have a mixed tree anymore.

@raphaelokon
Copy link
Contributor

@bmuenzenmeyer I think I got it wrong.
From a user perspective: Would it be possible to use an engine (I am actually working on something) that uses plain ES6 template literals and is essentially pure JS?

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

@raphaelokon I think it would, so long as you don't also have the React engine installed, which would introduce that conflict for .js files.

@raphaelokon
Copy link
Contributor

@geoffp Cheers. Makes sense.

@bmuenzenmeyer
Copy link
Member Author

bmuenzenmeyer commented Feb 15, 2017 via email

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

@bmuenzenmeyer mixed trees were a useful way for us to incrementally migrate our technology stack. I'd hate to see us prohibit it, but it does seem very reasonable for us not to go way out of our way to support it.

@raphaelokon are you doing some pure-functional JS templates or something? Tell us more! Is there editor support for markup in ES6 template literals?

@bmuenzenmeyer
Copy link
Member Author

bmuenzenmeyer commented Feb 15, 2017 via email

@geoffp
Copy link
Contributor

geoffp commented Feb 15, 2017

@bmuenzenmeyer I've got serious love for Handlebars. Such a great authoring experience.

@raphaelokon
Copy link
Contributor

raphaelokon commented Feb 15, 2017

@geoffp Yes. Basically it is a super simple template engine. PHPStorm highlights the html inside template literals and tagged literals templates. Also agree on handlebars.

@bmuenzenmeyer
Copy link
Member Author

@geoffp @raphaelokon 🔥 🔥 🔥

image

bmuenzenmeyer added a commit to pattern-lab/patternengine-node-handlebars that referenced this issue Sep 29, 2017
bmuenzenmeyer added a commit to pattern-lab/patternengine-node-underscore that referenced this issue Sep 29, 2017
bmuenzenmeyer added a commit to pattern-lab/patternengine-node-react that referenced this issue Sep 29, 2017
geoffp pushed a commit that referenced this issue Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants