These are chat archives for assetgraph/assetgraph

4th
Oct 2016
Munawwar
@Munawwar
Oct 04 2016 07:25
Good morning everyone.
How do you handle LESS/SASS without SystemJS with ag-b? (I am in middle of a making a small website)
Andreas Lind
@papandreou
Oct 04 2016 07:27
@Munawwar You can use system.js and the less plugin to load it, but then omit system.js and the config etc. using the data-systemjs-remove property: https://github.com/assetgraph/assetgraph/blob/master/testdata/transforms/bundleSystemJs/onlyLess/index.html
That way you only have system.js in development.
Munawwar
@Munawwar
Oct 04 2016 07:27
Cool. Ok.
Andreas Lind
@papandreou
Oct 04 2016 07:28
We really, really wanted to get rid of the transpilation :)
Munawwar
@Munawwar
Oct 04 2016 07:29
Yea, I remember voting for that myself. But it makes it more complicated for websites.
Andreas Lind
@papandreou
Oct 04 2016 07:30
Yeah, it does.
Peter Müller
@Munter
Oct 04 2016 08:34
This is where I really hoped we could do the assetgraph build on top of fusile, so the transpiling is taken care of and you could just include with <link>
I guess you could hook into the addasset event and do transpilation there? Haven't tried
Andreas Lind
@papandreou
Oct 04 2016 08:36
It's synchronous
Peter Müller
@Munter
Oct 04 2016 08:39
For v4 we should consider life cycle hooks to let people hook in for things like these
I think I shady created an issue for that
Andreas Lind
@papandreou
Oct 04 2016 08:40
For this particular use case I think we should recommend using system.js/webpack/etc.
Or fusile
Or even file-watcher-triggered grunt tasks.
Transpilation is a huge pain to support, and our users need to have a working dev setup, so most of them will already have one of the above in place.
Andreas Lind
@papandreou
Oct 04 2016 08:47
The lifecycle hooks could be a good idea for other reasons, of course :)
Peter Müller
@Munter
Oct 04 2016 09:02
They seem to be what enable the whole ecosystem and community for webpack
Andreas Lind
@papandreou
Oct 04 2016 09:03
What do you mean?
Peter Müller
@Munter
Oct 04 2016 09:03
Webpack is basically a hardcoded build pipeline. But at every step there is a hook where you can plug in stuff
Only reason it can even do what people need it to
If we had these escape hatches where we allowed people to step outside of the confines of completely valid html/css/js etc, then we might have an easier time onboarding plugins for templating, transpiling etc
Andreas Lind
@papandreou
Oct 04 2016 09:06
That's a good point. I'm unsure if we're ready to allow that kind of extensibility in our current state, though.
Munawwar
@Munawwar
Oct 04 2016 11:12
I like this idea. Say if ag-b doesn't want to support transpilers, then user could add a plugin to do that.
And Munter is right, that's what starts getting more people involved into the project.
Andreas Lind
@papandreou
Oct 04 2016 12:37
It's a niche we would have to carve out ourselves and get people excited about.
Peter Müller
@Munter
Oct 04 2016 12:44
The niche we're in doesn't get much deeper ;)
Andreas Lind
@papandreou
Oct 04 2016 12:46
I agree it's something we should keep on our radar and strive for when we do further refactorings, especially when we get around to improve the API.