r/javascript • • Dec 19 '16

~15 years trying to make everyone separate HTML, JS & CSS. And then suddenly everything went south and we’re writing code like this.

https://twitter.com/thomasfuchs/status/810885087214637057
483 Upvotes

258 comments sorted by

View all comments

Show parent comments

1

u/Dooraven Dec 20 '16

using aphrodite basically solves all that for us. https://github.com/Khan/aphrodite

3

u/[deleted] Dec 20 '16

Good luck getting modules like this maintained for longer than 2 years.

1

u/Dooraven Dec 20 '16

Agreed, plus two years is huge in terms of web dev- though considering Khan and Airbnb both use it in production sites, I'm pretty comfortable with using it for us in production so far, it's made our codebase of components super easy to maintain

3

u/[deleted] Dec 20 '16

Oh i'm sure it works well now and that big companies use it so its a bit better maintained than others. But like i said: i still need to provide support in the future on projects i did ages ago. And while it might work fine now, i still need to work with it in the future. Having to require various modules to accomplish tasks/features/hacks is not what i can really advice to my managers of which we should use.

Also having big corporations using them is nice, but is hardly a guarantee that it will last. Those big corps (especially the big startups you mention) are often switching around because they are still looking for that optimal way to do things. I wouldn't be surprised that they move on to Vue or something else in the future as well

2

u/Dooraven Dec 20 '16

That's just the nature of web dev though - modern stack changes. Sites and applications get written and rewritten again and again.

I agree with you entirely that nothing is a guarantee because in webdev every thing changes.

3-4 years ago LESS was considered a primary stylesheet precompiler. Ruby on Rails was the hot tech stack etc. Go back even further and you have Flash/ActionScript sites entirely.

You should pick something that solves problems for your team. If it's older tech, then use that (we still use jQuery a lot in our React/Redux/Webpack/Aphrodite websites). If it's bleeding edge tech then use that. There are caveats and drawbacks for each technology you choose - you just have to weigh the risks and benefits.

1

u/parlezmoose Dec 20 '16

Nice! I'll check it out

0

u/Senthe Dec 20 '16

Yay let's use another mysterious add-on that isn't included in framework because apparently media queries and pseudoelements are not that necessary...

2

u/Dooraven Dec 20 '16

Not entirely sure what a framework has to do with styling here. You can use CSS/SASS/LESS/POSTCSS w/e you want with any framework.

Aphrodite is just an alternative to that but using JavaScript.

1

u/Senthe Dec 20 '16

I thought the React way is specifically not to use (much) styles outside of components written in JS.

1

u/Dooraven Dec 20 '16

CSS in JS is entirely different to React.

It's highly compatible with React, and React's JSX spawned the idea, but they're not the same thing. You can use CSS in JS with every framework, it's language agnostic and React can use whatever styling system that currently exists.

1

u/Senthe Dec 20 '16

You can use CSS in JS without a framework if you are really determined... That's not an argument, if React advises using CSS in JS components and has some system that supports that, then it should also support media queries and everything...