Re:Build your own web framework
by mccorrinall on Friday July 29, 2022 @07:56PM
(#32283012)
Babel transpiles js to browsers which are older than me. You should give it a try.
Re:Build your own web framework
by cercatrova on Friday July 29, 2022 @10:42PM
(#32283842)
If it's only one file, you could just go to the Babel website where they have a playground and paste it in, voilà, converted for older browsers. Now place the output file wherever you want.
Not sure if they edited their comment (although it seems unlikely given that your comment was four hours later), but that sounds exactly like what they said they did. Maybe I'm old-fashioned, but the idea that I need to upload a plaintext file to have it converted to another plaintext file so I can download it instead of just having a command to run locally seems almost surreal.
Re:Build your own web framework
by cercatrova on Saturday July 30, 2022 @03:04PM
(#32289384)
There is a command to run locally, `babel`. It works in the command line as well as part of a build tool. It seemed me that the parent however didn't want to spend more time learning all that if they needed to convert just one file.
yeah, I did get it to transpile with the babel command, but I couldn't get it to accept the babel-env preset, so it just transpiled from modern javascript to modern javascript, which is not very useful
I mean I'm sure it's possible somehow, but it sure isn't obvious. And I get that this is not at all the usual use case for it, but still