InterLinked1 / chromefill

Automatically injects polyfills for old Chromium into webpages
Apache License 2.0
15 stars 1 forks source link

Improve transpiling efficiency #2

Open InterLinked1 opened 2 years ago

InterLinked1 commented 2 years ago

The recently added on-the-fly transpiling support is very inefficient (hence it being whitelisted on a per-domain basis), and quite honestly overkill for what's needed here: transpiling only nullish coalescing and optional chaining. Babel doesn't seem to support this in the proper way.

As noted on the MSFN forums, there is probably a more efficient way to approach this:

For GitHub exclusively, you may want to have a look at https://github.com/martok/palefill/issues/29#issuecomment-1186046465 and https://github.com/dirkf/palefill/commits/df-optchain-patch https://github.com/dirkf/palefill/releases/tag/v1.19df

The dev(s) use simple transpiling JS code for just those two operators, nothing more (the rest can be handled by polyfills)

Ideally, the transpiling should only analyze for these operators and nothing else.