3 ms·
JavaScript itself has a complicated, hairy history. It's hard to write a single line of code without wondering, must I query https://caniuse.com https://caniuse
by JMTQp8lwXL 7y ago
JavaScript itself has a complicated, hairy history. It's hard to write a single line of code without wondering, must I query https://caniuse.com https://caniuse.com to be sure this API is supported by all of my organization's targeted browsers? It shouldn't be all that surprising, that in order to rectify the lack of parity, we have to accept come additional levels of complexity in our tooling.
Sure, I could import all of corejs and call it a day. Everything would be polyfilled, but then I'd be wasting precious bytes and negatively impacting page load times. Some will even say the concern is no more than bikeshedding. But if you give little thought to bundle optimization, your carelessness will add up, and materially impact TTFB. It's a death by a thousand cuts.
My personal answer is no. Whether it's Stockholm Syndrome or not, you can conquer the complexities of shipping web applications written in modern JavaScript.
Becoming aware of the nuances has made me a stronger developer. Developing a deep understanding of polyfills, bundlers, transpilers, module formats (CJS, SystemJS, UMD, ES Module) and which browsers support which APIs has made led to me being more thoughtful in the code that I write. For people just looking to solve a business problem, without understanding the more tedious parts of JavaScript, it absolutely is too complicated for them. I empathize. But if you want to be a skilled front-end software engineer, it's in your interest to tackle these tools with some zeal.
- xthestreams 7y ago> But if you want to be a skilled front-end software engineer, it's in your interest to tackle these tools with some zeal. I guess what we are saying is that there must be a better, not yet invented way to do frontend, without having to deal with this huge complexity that is unique to this specific field.
- JMTQp8lwXL 7y agoYou can make it zero-config, polyfill everything, apply all babel plugins so everything is transpiled to support IE 7, for all you care. But everyone has different needs. So tools like Babel and Webpack allow you to pick-and-choose what polyfills and transpilations are necessary.