-
Notifications
You must be signed in to change notification settings - Fork 12k
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
initial support for jade/pug templates #2205
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
See #1886 (comment) |
@ShadowManu how is it going? are you going to add documentation/e2e tests soon? thanks, looking forward to this getting merged :D |
I actually could have time today or this week, I haven't forgot. Just had a busy one ;) |
d65009d
to
0681292
Compare
Hm, maybe with By default using Pug in the Angular2 context also brings a few pain points compared to using HTML:
Might those perhaps be useful since our Pug use-case specifically pertains Angular2 here? |
Answering from phone, so forgive my lack of links (and of course the autocorrects)
|
On the plugin, one point I might add is it doesn't so much hurt the default notation (as one might use without it), but yeah. I do agree allowing overall customization would be preferable. Perhaps I should check if ng-cli already allows overriding parts of its webpack config... so far from the documentation I hadn't been under the impression this was currently possible though. But overrides could potentially take care of other use-cases as well. Heck, people would no longer need to wait for ng-cli to accept PRs for specific additions, while ng-cli would work out by delegating feature addition to webpack without taking on additional dependencies. |
@ShadowManu any updates on this pr? IMO setting the html doctype as a global default should be done for angular projects. |
+1 on this. A neat fix and seems ready for merge. |
Something is wrong with index.html. The output is being index.pug after Ι changed the config, and |
We are currently using this PR with the knowledge that it only affects templates and not index.html. Happy to see it merged in the short term and then another PR to make index.pug run through the parser. |
@@ -96,6 +96,7 @@ export function getWebpackCommonConfig( | |||
{ test: /\.json$/, loader: 'json-loader' }, | |||
{ test: /\.(jpg|png|gif)$/, loader: 'url-loader?limit=10000' }, | |||
{ test: /\.html$/, loader: 'raw-loader' }, | |||
{ test: /\.(pug|jade)/, loaders: ['apply-loader', 'pug-loader']}, |
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.
In the event one you'd want to add configuration here, it seems that could be done as follows:
{
test: /\.(pug|jade)$/,
loader: 'apply',
},
{
test: /\.(pug|jade)$/,
loader: 'pug',
query: { doctype: 'html' },
},
Earlier I feared for my plugin thing I'd need to use the single loader instead (pug-html
), but it seems that'd work fine with your setup as well.
is there something specific this that is blocking this PR. I'm happy to pitch in. |
|
I'd gladly defer plugin discussion to a separate thread, since it shouldn't be blocking initial support. Dynamic templating, I've made a bit of use of even in the Angular 2 context so far, but for the most part you'd want to relegate this logic to Angular. I did like the ability to I'd help resolve the merge conflict, but I fear the PR isn't mine. :P |
This is too initial; it may just confuse newcomers. No Regarding pug itself: unnecessary functionality, it's syntax sugar can be easily replaced by emmet. |
There seem to be two conflicting points of contention. A.) This PR is incomplete I want it and am happy to help finish it, but will not probably get into the weeds if is to be a rejected feature. I don't see finishing this as a huge hurdle (docs, ng generate ect ...) so I think the only conversation to be had is point B.)
This same over generalized argument can be made for sass or typescript really. |
Regarding Point B: |
@niklas-dahl: this makes some sense; the Angular team does in fact like it themselves. :) |
Hi @ShadowManu, in anticipation of getting basic support in I tried to see if I could get a little progress here. I couldn't make a PR to your fork as I already had a fork of the original of my own, but I tried to go from your branch to resolve merge conflicts and add a little documentation/testing, see here. |
Sorry If I can't help that much, since I'm on travel. I tried to follow the advice Filipe gave he as a comment in the original issue, trying to copy tests for |
@ShadowManu: I tried adding tests along those lines as well now. (I'm not sure what's up with running them -- the part that's failing wasn't my code.) |
Any news on this? |
Closing, please see #1886 (comment) for context. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This is a PR regarding #1886. It doesn't include documentation changes (this is to allow using
.pug
files in components the same way we already can use.scss
files on them), but its a start to know what you guys think / what is missing. Thanks.