-
Notifications
You must be signed in to change notification settings - Fork 305
CSS preprocessors, JavaScript compilers, and the Meteor Build Tool #41
Comments
The initial outline: Meteor guide: The build toolMeteor brings sane, zero-configuration defaults to the previously tedious tasks of compiling, concatenating, minifying, and transforming assets.
We should also link to the section about making your own build plugin. |
A section about how to use css Autoprefixer after compiling scss/less/etc will be great. |
Let's look at some key decisions that need to be made: Easy parts
Probably easy
Need research
Anything else I missed? |
@stubailo I've used Then I saw there is no scss support in core and decided to give a try to So, I decided to switch back to gulp until the build system will have stable scss and autoprefixer support. The Autoprefixer is absolutely a must in websites for me. |
I don't know, if there is a way to do that now (post processing of css), but it is just a simple step in the build system - grab the css, push it through autoprefixer with options and store it. It is available everywhere - gulp, grunt, webpack, etc. |
An autoprefixer is absolutely necessary. We have several projects that we simply cannot upgrade to 1.2 until we have one. |
What were you using before 1.2? |
Not that some CSS pre-processors (such as |
@mquandalle we were having a parallel conversation here: Meteor-Community-Packages/meteor-scss#133 It seems like the best option might be to build it into the minifier? Although maybe if your stylus package works fine then it's a good approach for now! @sebakerckhof was also considering having a separate branch with autoprefixer. But it seems somewhat silly to have everyone (stylus, less, scss) build in autoprefixer separately if we could do it once? |
@stubailo Our projects are 1.1 right now (ignoring the one that's stuck at .7...). |
@adrianbw I meant, what were you using for autoprefixing. |
Ohhh, sorry. fourseven's package. |
I'm really glad we found out about this whole autoprefixer thing. We now have a few issues in meteor/meteor about it: meteor/meteor#5219 I'd love if anyone could help with either. |
@orefalo, @fullflavedave, can you tell me more about using TypeScript with Meteor? Is it something you are doing regularly? I'm mentioning you since you seem to be the main maintainers of this org: https://github.com/meteor-typescript |
I use TypeScript and the typescript-libs package every day in my current project, which I've been working on for well over a year. As you may have seen in the README, the definitions are obtained by parsing the Meteor data.js file and mapping/modifying some of the data. @D1no mentioned that he had been working on creating an integrated TypeScript compiler plugin using the definitions, but I'm not sure what the status is: https://github.com/meteor-typescript/meteor-typescript-libs/issues/25. Currently, I let WebStorm compile my TypeScript files into JS, although @orefalo created a compiler package that can be used. |
The Meteor-angular2 project (https://github.com/Urigo/Meteor-Angular2) seems to use this typescript compiler plugin: https://github.com/barbatus/ts-compilers |
Lack of time, I can't focus on the typescript compiler anymore. I heard the build system was changed in 1.2 but didn't find time to refactor the code just yet. Please provide some context... what is the ask? |
@orefalo I'm writing an article for the Meteor guide, which is supposed to be a resource that tells you most of what you need to know to write a Meteor app. I am wondering if it is feasible to write a Meteor app in TypeScript, and what kind of guidance I should give to an enterprising developer looking to do so. |
@mquandalle how is Bower doing? I see the 1.2 branch is still open, but does it work well enough now? Or does it not work at all with Meteor 1.2? Also, what about Jade? |
@fullflavedave @stubailo though it is completely feasible to build a (solid) TypeScript compiler for .ts and .tsx files for meteor app and packages, we realised that we don't have a good answer how to handle the uni-module aspect of TypeScript (lazy loading etc). So instead of writing a complete module loader from scratch, we switched the ecosystem approach by using meteor with webpack and therewith npm. The meteor TypeScript compiler, ideally, would implement the language service api of the native npm package so that running TypeScript in the IDE is not necessary (just for linting). So there is currently no "native" implementation of TypeScript for meteor due to the unclear future of module management. If you want to use TypeScript - which you should - I would advice to go for a webpack centered solutionwith the TypeStrong/ts-loader (for now): https://github.com/thereactivestack/meteor-webpack |
OK, I posted an outline here: #67 |
@izakfilmalter, can you let me know about the tradeoffs between https://atmospherejs.com/seba/minifiers-autoprefixer and https://atmospherejs.com/juliancwirko/postcss in your app? We should make sure we can recommend something that works! |
@stubailo for us the postcss is failing with our oath2 npm package we are using.
But everything works fin with https://atmospherejs.com/seba/minifiers-autoprefixer . I would prefer the postcss plugin because we can actually manage what versions of autoprefixer we are on and use postcss. But it seams to want to post process js files as css. Once I remove the oath2 package I just get Note we do have 178 scss files. This is still using the old version of https://github.com/fourseven/meteor-scss with autoprefixer disabled. Compile time is less than 30sec normally for me. |
Well, any of those bugs in the postcss package should be easy to fix. I think the main difference between my package and the postcss package is that the postcss package is much more flexible, but requires more configuration to set up. |
Ya @sebakerckhof with your package we have the same issue as the old https://github.com/fourseven/meteor-scss . It works turn key with little config, but we are dependent on you keeping up to date with autoprefixer. But with postcss, yes slightly more config, one more |
@izakfilmalter which version of the postcss package causes problems? With my quick tests it seems to work well. There isn't a bug with oauth2-server npm package. With fourseven:scss@3.4.1 too. (Of course I have only one .scss file for tests) Autoprefixer works on .css and .scss.
There was an important fix in version 0.2.1 of the juliancwirko:postcss. Postcss now should know which npm package is a plugin and which isn't, but probably it could be done better. Maybe there are some corner cases. |
I am on the newest version of your plugin @juliancwirko. I am still on |
Article outline
https://github.com/meteor/guide/blob/master/outlines/build-tool.md
Major decision points
ecmascript
package, if you really want to you can usecoffeescript
instead but all of our code samples will be against ES2015.meteorhacks:npm
andcosmos:browserify
are the best optionsThe text was updated successfully, but these errors were encountered: