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

Support new target "baseline"/"baseline2022" #3584

Closed
Shinigami92 opened this issue Jan 10, 2024 · 4 comments
Closed

Support new target "baseline"/"baseline2022" #3584

Shinigami92 opened this issue Jan 10, 2024 · 4 comments

Comments

@Shinigami92
Copy link

Shinigami92 commented Jan 10, 2024

Describe what esbuild is doing incorrectly and what it should be doing instead.

Add support for new targets like baseline and baseline2022.

Using these targets will result in aliases to the related browsers like baseline2022 == [chromeX, firefoxX, safariX]

Links:

Examples:

(esbuild docs: https://esbuild.github.io/api/#target)

Provide a way to reproduce the issue.

The best way to do this is to demonstrate the issue on the playground (https://esbuild.github.io/try/) and paste the URL here. A link to a minimal code sample with instructions for how to reproduce the issue may also work.

https://esbuild.github.io/try/#dAAwLjE5LjExAC0tdGFyZ2V0PWJhc2VsaW5lMjAyMgA

Error: Invalid target "baseline" in "--target=baseline2022"

https://esbuild.github.io/try/#dAAwLjE5LjExAC0tdGFyZ2V0PWJhc2VsaW5lAA

Error: Invalid target "baseline" in "--target=baseline"
@evanw
Copy link
Owner

evanw commented Jan 10, 2024

Using these targets will result in aliases to the related browsers like baseline2022 == [chromeX, firefoxX, safariX]

I looked pretty hard for this data for ~30 minutes and couldn't find anything. Do you know if this data is published anywhere? I won't build this kind of feature without an official data source to pull from. The closest I could find was this but it's still really unclear to me what this means or how to interpret it. It would be so much easier to understand this thing if they had defined it like this (e.g. "baseline 2022" is anything that works in Chrome X, Firefox Y, and Safari X).

One thing I don't understand from their complicated definition is the mental model: I can't tell if the underlying data is even of this form (or can be made to be in this form) or if it's just a hand-picked assorted list of features that don't actually map to real browser versions. It certainly seems like the features are hand-picked instead of automated based on the relevant PRs in that repo.

Error: Invalid target "baseline" in "--target=baseline2022"
Error: Invalid target "baseline" in "--target=baseline"

I think it's reasonable to have a target like baseline2022 but I don't plan on including target environments without numbers attached like baseline. My reasoning is that this is a moving target which would make builds non-deterministic as the definition of baseline changes over time. Having deterministic builds is a priority for esbuild.

@Shinigami92
Copy link
Author

I don't really understand it either right now 😕
But instead of just not doing it, we should ask and send feedback to https://github.com/web-platform-dx/web-features

But I cant for the next days, cause I'm away until sunday evening

@evanw
Copy link
Owner

evanw commented Jan 24, 2024

I asked and sent feedback and got an excellent reply in the thread linked above. It seems like perhaps this isn't a good fit for esbuild after all. The definition is intended to change over time by design (e.g. as people's preferred browsers change), which goes against my goal of deterministic builds.

Browserslist (see #324) is another example of a non-deterministic target like this that I'm not planning to add to esbuild. It lets you specify targets like current node which will do something different when you run it at different points in time. I'm not saying it's not useful (it definitely is) but just that I don't want it to be something that esbuild supports.

@Shinigami92 Shinigami92 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2024
@Shinigami92
Copy link
Author

Perfect timing, I will forward this to the other Vite team members in today's meeting 👌
Because we will adept to that same decision then 👍
Thanks for the effort

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