Listen "415: Babel Choices"
Episode Synopsis
Robert and Chris hop on the show to talk about choices we've had to make around Babel.
Probably the best way to use Babel is to just use the @babel/preset-env plugin so you get modern JavaScript features processed down to a level of browser support you find comfortable. But Babel supports all sorts of plugins, and in our Classic Editor, all you do is select "Babel" from a dropdown menu and that's it. You don't see the config nor can you change it, and that config we use does not use preset env.
So we're in an interesting position with the 2.0 editor. We want to give new Pens, which do support editable configs, a good modern config, and we want all converted Classic Pens a config that doesn't break anything. There is some ultra-old cruft in that old config, and supporting all of it felt kinda silly. We could support a "legacy" Babel block that does support all of it, but so far, we've decided to just provide a config that handles the vast majority of old stuff, while using the same Babel block that everyone will get on day one.
We're still in the midst of working on our conversion code an verifying the output of loads of Classic Pens, so we'll see how it goes!
Time Jumps
Probably the best way to use Babel is to just use the @babel/preset-env plugin so you get modern JavaScript features processed down to a level of browser support you find comfortable. But Babel supports all sorts of plugins, and in our Classic Editor, all you do is select "Babel" from a dropdown menu and that's it. You don't see the config nor can you change it, and that config we use does not use preset env.
So we're in an interesting position with the 2.0 editor. We want to give new Pens, which do support editable configs, a good modern config, and we want all converted Classic Pens a config that doesn't break anything. There is some ultra-old cruft in that old config, and supporting all of it felt kinda silly. We could support a "legacy" Babel block that does support all of it, but so far, we've decided to just provide a config that handles the vast majority of old stuff, while using the same Babel block that everyone will get on day one.
We're still in the midst of working on our conversion code an verifying the output of loads of Classic Pens, so we'll see how it goes!
Time Jumps
More episodes of the podcast CodePen Radio
417: Iframe Allow Attribute Saga
18/11/2025
416: Upgrading Next.js & React
05/11/2025
414: Apollo (and the Almighty Cache)
23/10/2025
413: Still indie after all these years
14/10/2025
412: 2.0 Embedded Pens
09/10/2025
411: The Power of Tree-Sitter
01/10/2025
409: Our Own Script Injection
16/09/2025
408: Proxied Third-Party JavaScript
09/09/2025
407: Our Own CDN
02/09/2025
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.