Skip to content

Commit 5b06ecc

Browse files
authored
fix: Restrict officially supported browserlist (#2159)
Closes #1752
1 parent 1d51585 commit 5b06ecc

5 files changed

Lines changed: 77 additions & 6 deletions

File tree

.browserslistrc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Use the default value for browsers we support https://browsersl.ist/#q=defaults
2-
# Used by post-css only, JS browser targeting is controlled by Vite https://vitejs.dev/config/build-options.html#build-target
3-
4-
defaults
1+
last 0.5 years and Chrome > 0
2+
last 0.5 years and Edge > 0
3+
last 0.5 years and Opera > 0
4+
last 0.5 years and Firefox > 0
5+
last 1 years and Safari > 0
6+
Firefox ESR and not dead

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ npx source-map-explorer 'packages/code-studio/build/static/js/*.js'
268268

269269
## Browser Support
270270

271-
Support is best for [Google Chrome](https://www.google.com/intl/en_ca/chrome/) and Chromium based browsers (such as [Microsoft Edge based on Chromium](https://www.microsoft.com/en-us/edge)). We try and maintain compatibility with [Mozilla Firefox](https://www.mozilla.org/en-CA/firefox/new/) and [Apple Safari](https://www.apple.com/ca/safari/) as well.
271+
Support is best for [Google Chrome](https://www.google.com/intl/en_ca/chrome/) and Chromium based browsers (such as [Microsoft Edge based on Chromium](https://www.microsoft.com/en-us/edge)). We also maintain compatibility with [Mozilla Firefox](https://www.mozilla.org/en-CA/firefox/new/) and [Apple Safari](https://www.apple.com/ca/safari/).
272+
273+
Officially, the following browsers and corresponding configurations are supported:
274+
275+
- Chrome: Versions from the last 0.5 years
276+
- Edge: Versions from the last 0.5 years
277+
- Opera: Versions from the last 0.5 years
278+
- Firefox: Versions from the last 0.5 years, including Firefox ESR
279+
- Safari: Versions from the last 1 year
272280

273281
If you encounter an issue specific to a browser, check that your browser is up to date, then check issues labeled with [firefox](https://github.com/deephaven/web-client-ui/labels/firefox) or [safari](https://github.com/deephaven/web-client-ui/labels/safari) for a list of known browser compatibility issues before reporting the issue.

package-lock.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"@types/shell-quote": "^1.7.1",
106106
"@vitejs/plugin-react-swc": "^3.3.0",
107107
"@vscode/codicons": "0.0.36",
108+
"browserslist-to-esbuild": "^2.1.1",
108109
"chokidar-cli": "^2.1.0",
109110
"conventional-changelog-conventionalcommits": "^7.0.0",
110111
"cross-env": "^7.0.2",

packages/code-studio/vite.config.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This is a dev dependency for building, so importing dev deps is fine
22
/* eslint-disable import/no-extraneous-dependencies */
33
import { defineConfig, loadEnv } from 'vite';
4+
import browserslistToEsbuild from 'browserslist-to-esbuild';
45
import react from '@vitejs/plugin-react-swc';
56
import path from 'path';
67

@@ -100,7 +101,9 @@ export default defineConfig(({ mode }) => {
100101
outDir: path.resolve(__dirname, env.VITE_BUILD_PATH),
101102
emptyOutDir: true,
102103
sourcemap: true,
103-
target: 'esnext',
104+
build: {
105+
target: browserslistToEsbuild(),
106+
},
104107
rollupOptions: {
105108
output: {
106109
manualChunks: id => {
@@ -143,5 +146,14 @@ export default defineConfig(({ mode }) => {
143146
devSourcemap: true,
144147
},
145148
plugins: [react()],
149+
esbuild: {
150+
/**
151+
* Prevents ESBuild to throw when using a feature not supported by the
152+
* list of supported browsers coming from the `browserslist` file.
153+
*/
154+
supported: {
155+
'top-level-await': true,
156+
},
157+
},
146158
};
147159
});

0 commit comments

Comments
 (0)