Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is exactly what I have been looking for... #1

Open
mercmobily opened this issue Oct 27, 2017 · 6 comments
Open

This is exactly what I have been looking for... #1

mercmobily opened this issue Oct 27, 2017 · 6 comments

Comments

@mercmobily
Copy link

Hi,

This is precisely what I've been looking for.
Impressive!
Are you actively maintaining it? Are you using it in a production environment?

Finally... how would you go, if you were to support transpiling of Javascriptwithin HTML? (in a <script> element, that is)

Thank you!

Merc.

@matAtWork
Copy link
Collaborator

It is in production, and it does work, although it's not had much love recently - the kangax tables are probably out of date since there have been a few major releases of Chrome, FF and Safari at least.

It doesn't currently attempt to parse or understand scripts within HTML. This is a medium sized update, and with no demand at our end it's unlikely to get done, but feel free to update and submit a PR

@matAtWork
Copy link
Collaborator

...oh, and the list of ES features is incomplete (as per the README), since so far we've only implemented ones we use in our projects.

@mercmobily
Copy link
Author

I am very, very interested in having real-time transpiling of code. I would like to push ahead features I need (especially when using Polymer), kangax tables and ES features. You open to 1) Accept help 2) Offer a bit of guidance at the beginning?

@matAtWork
Copy link
Collaborator

Definitely (2), and (1) if I get the time.

The main task is mapping the kangax identifiers (like arrow_functions) to the Babel plugins that support the feature (like babel-plugin-transform-es2015-arrow-functions). These are mapped in the block at https://github.com/MailOnline/transpile-middleware/blob/master/transpile.js#L36.

There are npm jobs (as specified in the README) to update the UA's and Kangax data - these should just run, although you should probably add some tests (there's a few very simple ones at present).

@mercmobily
Copy link
Author

I just talked to the Babel developer. He suggested we use https://github.com/babel/babel-preset-env which is maintained and was created for the exact purpose of figuring out browser capability.

I am poking blind here, but is this something you would like to look into?

@matAtWork
Copy link
Collaborator

I'm not familiar with babel-preset-env, but it looks like it's doing something very similar. We're unlikely to change ourselves, since transpile-middleware does what we want, but I'd guess you'd get better support from the babel project, although that doesn't always apply to plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants