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

Use es2019 in vite config #1553

Merged
merged 5 commits into from May 31, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -65,6 +65,7 @@
- Added a new prop to `FeatureListSubscriber` to read in `showTable`, having it false by default.
- Modified the `FeatureList` component to pass in 2 columns and 2 column labels if `showTable` is true, otherwise just 1 column and 1 columnLabel if `showTable` is false.
- Modified the `SelectableTable` component and the table styles to handle showing 2 cells per row.
- Use `es2019` in Vite bundle targets for `packages/main/prod` and `packages/main/dev` to support HuBMAP portal-ui.
- Changes in `ToolMenu`:
- Added a new button that calls `onRecenterButtonCLick` function on click.
- Added css for the new button and introduced differentiation between a button and a tool.
Expand Down
22 changes: 21 additions & 1 deletion consumer/README.md
Expand Up @@ -26,4 +26,24 @@ Related directories/files:
- `pages/`
- `next.config.js`

Open http://localhost:3003/consumer/out/index.html
Open http://localhost:3003/consumer/out/index.html


## How to test in portal-ui

Instructions as of 5/26/2023 (commit hash [hubmapconsortium/portal-ui#fc8a881f](https://github.com/hubmapconsortium/portal-ui/commit/fc8a881ff6f793b4a0dbbeed60f2186fe9d880c4))

```sh
pnpm run build
pnpm run bundle
./scripts/consumer-install.sh

cd ../portal-ui/context
npm install

# comment out `npm install` line in ./etc/dev/dev-start.sh

npm install $(ls ../../vitessce/consumer/vitessce-*.tgz)
cd ..
./etc/dev/dev-start.sh # open http://localhost:5001
```
1 change: 1 addition & 0 deletions packages/main/dev/vite.config.js
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
emptyOutDir: false,
minify: isProduction ? 'esbuild' : false,
sourcemap: false,
target: 'es2019', // portal-ui cannot handle the nullish coalescing output by ESNext
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this a reversion? i don't know enough about es versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure what you mean by reversion - the Vite docs say the default target is 'modules' which is effectively es2020

Copy link
Member Author

Choose a reason for hiding this comment

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

So it is going backwards in a way but it should not have an effect on the functionality.

I think it is possible that perhaps there will be new syntax in future es targets that we would not want to be transpiled away / might not be possible to use under an earlier target. For this reason, we should still track the status of the portal-ui bundling setup to potentially remove or bump the target in the future, and we can let the portal-ui developers know

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I'm fine with that. As long as they know. I'm sure upgrading to v5 would have benefits.

lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'vitessce',
Expand Down
1 change: 1 addition & 0 deletions packages/main/prod/vite.config.js
Expand Up @@ -15,6 +15,7 @@ export default defineConfig({
emptyOutDir: false,
minify: isProduction ? 'esbuild' : false,
sourcemap: false,
target: 'es2019', // portal-ui cannot handle the nullish coalescing output by ESNext
lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'vitessce',
Expand Down