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 old browsers in @vitest/browser #4304

Closed
4 tasks done
edoardocavazza opened this issue Oct 13, 2023 · 3 comments
Closed
4 tasks done

Support old browsers in @vitest/browser #4304

edoardocavazza opened this issue Oct 13, 2023 · 3 comments
Labels
p3-significant High priority enhancement (priority)

Comments

@edoardocavazza
Copy link

Clear and concise description of the problem

Right now, the @vitest/browser is built using default vite targets. Since the client library is served through a sirv middleware, it does not get transpiled by the vite server during tests. This lead old browsers without optional chaining support to a syntax error.

Suggested solution

Would you consider to build @vitest/browser using the lowest esbuild target available?

Alternative

Is it possibile to make vite to serve the client library without sirv?

Additional context

I am building a provider for Saucelabs browsers.

Validations

@sheremet-va
Copy link
Member

Should be fine as long as they support import syntax.

@sheremet-va sheremet-va added the p2-to-be-discussed Enhancement under consideration (priority) label Feb 16, 2024
@sheremet-va
Copy link
Member

As a team, we decided it would be a good idea to support this. The browser compatibility table looks like this, so we should follow it instead of arbitrary es2017: https://vitejs.dev/guide/build.html#browser-compatibility

@sheremet-va sheremet-va added p2-nice-to-have Not breaking anything but nice to have (priority) p3-significant High priority enhancement (priority) and removed p2-to-be-discussed Enhancement under consideration (priority) p2-nice-to-have Not breaking anything but nice to have (priority) labels Jun 18, 2024
@sheremet-va
Copy link
Member

Actually, @vitest/browser assets are now served by the Vite server, not sirv so they follow the Vite target.

@sheremet-va sheremet-va closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-significant High priority enhancement (priority)
Projects
Archived in project
Development

No branches or pull requests

2 participants