Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Use the default value for browsers we support https://browsersl.ist/#q=defaults
# Used by post-css only, JS browser targeting is controlled by Vite https://vitejs.dev/config/build-options.html#build-target
Copy link
Copy Markdown
Member

@mofojed mofojed Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at this comment you removed (about how this is just for post-css...). We need to wire up Vite to use .browserslistrc in place of build.target using the browserslist-to-esbuild module it looks like: vitejs/vite#11489

Otherwise this .browserslistrc is only going to be used for CSS, and not used when building JS.

A blog post about Vite and browserslist may be information as well: https://dev.to/meduzen/when-vite-ignores-your-browserslist-configuration-3hoe

We should also be able to compare the package size before/after and see the impact (check the size of the code-studio/build folder after doing an npm run build before and after).


defaults
last 0.5 years and Chrome > 0
last 0.5 years and Edge > 0
last 0.5 years and Opera > 0
last 0.5 years and Firefox > 0
last 1 years and Safari > 0
Firefox ESR and not dead
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ npx source-map-explorer 'packages/code-studio/build/static/js/*.js'

## Browser Support

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.
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/).

Officially, the following browsers and corresponding configurations are supported:

- Chrome: Versions from the last 0.5 years
- Edge: Versions from the last 0.5 years
- Opera: Versions from the last 0.5 years
- Firefox: Versions from the last 0.5 years, including Firefox ESR
- Safari: Versions from the last 1 year

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.
60 changes: 54 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"@types/shell-quote": "^1.7.1",
"@vitejs/plugin-react-swc": "^3.3.0",
"@vscode/codicons": "0.0.36",
"browserslist-to-esbuild": "^2.1.1",
"chokidar-cli": "^2.1.0",
"conventional-changelog-conventionalcommits": "^7.0.0",
"cross-env": "^7.0.2",
Expand Down
14 changes: 13 additions & 1 deletion packages/code-studio/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This is a dev dependency for building, so importing dev deps is fine
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig, loadEnv } from 'vite';
import browserslistToEsbuild from 'browserslist-to-esbuild';
import react from '@vitejs/plugin-react-swc';
import path from 'path';

Expand Down Expand Up @@ -100,7 +101,9 @@ export default defineConfig(({ mode }) => {
outDir: path.resolve(__dirname, env.VITE_BUILD_PATH),
emptyOutDir: true,
sourcemap: true,
target: 'esnext',
build: {
target: browserslistToEsbuild(),
},
rollupOptions: {
output: {
manualChunks: id => {
Expand Down Expand Up @@ -143,5 +146,14 @@ export default defineConfig(({ mode }) => {
devSourcemap: true,
},
plugins: [react()],
esbuild: {
/**
* Prevents ESBuild to throw when using a feature not supported by the
* list of supported browsers coming from the `browserslist` file.
*/
supported: {
'top-level-await': true,
},
},
};
});