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

Allow destructuring for all target environments #3743

Open
augnustin opened this issue Apr 30, 2024 · 1 comment
Open

Allow destructuring for all target environments #3743

augnustin opened this issue Apr 30, 2024 · 1 comment

Comments

@augnustin
Copy link

augnustin commented Apr 30, 2024

I'm aware this may not be the right place to post this, and I am sorry for that if so, but using stackoverflow doesn't feel right neither.

I'm very amazed with what esbuild does and love it.

My current build config is --target=chrome58,firefox57,safari11,edge16 and I need large browser compatibility.

But with this target, I can't use destructuring. This is a terrible constraint for anyone like me used to writing code this way.

[0] ✘ [ERROR] Transforming destructuring to the configured target environment ("chrome58", "edge16", "firefox57", "safari11") is not supported yet

But what gives me hope is the "yet". Is it forecasted any how? The roadmap doesn't seem to mention it any how. Nor did the issues.

What suprises me the most is that it doesn't seem too hard to "babelize" (compared to boilerplating await/async behavior for instance).

Or did I miss something?

Thanks for reading

@evanw
Copy link
Owner

evanw commented May 2, 2024

"Yet" is there both because at the time the issue regarding ES5 support hadn't been closed yet, and because it's something that esbuild might hypothetically still support in the future. However, I have since closed the issue about ES5 support because I have decided to not prioritize esbuild lowering things to ES5 given how widespread ES6 support is. So it's not that esbuild can't do it or that it won't, but that it's very low priority.

FWIW the reason destructuring isn't supported by your target build environment is that it includes edge16. Wikipedia has this to say about Microsoft's non-Chromium "Edge Legacy" browser (see here):

Microsoft stopped supporting Microsoft Edge Legacy on March 9, 2021.[64][65] On April 13, 2021, Microsoft released a cumulative monthly security update which replaced Edge Legacy with the new Chromium-based Edge.[66]

So it sounds like Microsoft is both a) not supporting this browser at all anymore, meaning it's now insecure and unsafe to use on the Internet due to lack of security updates and b) already pushed out code to actively overwrite it with their Chromium-based browser over two years ago. So one option to consider is dropping support for these really old+insecure+deprecated versions of Microsoft Edge (i.e. changing edge16 to edge18 to pick up destructuring support).

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