-
Notifications
You must be signed in to change notification settings - Fork 22
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
Update Vite to v6, full minify esDynamic #2490
Conversation
Your demo site is ready! 🚀 Enhanced Testing: Legacy Testing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, whats the difference between folders bundler
and esDynamic
. They both look chunky build outputs but are not identical.
Reviewed 4 of 6 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @milespetrov)
src/fixtures/settings/templates/input-control.vue
line 24 at r2 (raw file):
<script setup lang="ts"> import config from '@arcgis/core/config';
lol good catch. I'm assuming someone did a mistake auto-import when typing the props. And the Vue binding to the prop fools VSCode into thinking it's actively used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundler
files don't include any ramp dependencies and are not fully minified. The consuming project will npm grab our deps and their bundler will smash things together as it pleases. esDynamic
has all dependencies included and is fully minified. It is used as is, no npm or build steps required.
So if you have a project that has shared dependencies with ramp, say vue and ag-grid, then npm installing ramp (bundler files) is best because both ramp and your project code will share one copy of shared deps. With esDynamic
ramp will always have its own deps and your project will have another copy.
Reviewable status: 4 of 7 files reviewed, all discussions resolved (waiting on @james-rae)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks. And I'mma assume this line in pacakge.json is what makes npm
smart to this and "it just works"
"module": "./dist/bundler/ramp.bundle.es.js"
Reviewed 2 of 3 files at r3, all commit messages.
Reviewable status: 6 of 7 files reviewed, all discussions resolved (waiting on @milespetrov)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @milespetrov)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got it
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @milespetrov)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1, 2 of 3 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @milespetrov)
Changes
dist/bundler
esDynamic
cssFileName
option in vite v6fixtures/settings/templates/input-control.vue
showing up on GitHubNotes
vite doesn't yet handle the case for es builds in library mode for native only imports. It assumes there will always be a bundler so it leaves the output partially unminified (things like pure annotations that are required by bundlers). Since
esDynamic
is meant for native in browser imports only its safe to force a full minification. More info: vitejs/vite#6555Size tally (initial download, gzip)
main branch: 1850 kB
PR #2489: 1523 kB (dynamic imports)
This PR: 1309 kB (full minification, including above pr)
QA Testing
Please test against
main
branch https://ramp4-pcar4.github.io/ramp4-pcar4/main/index-esm.htmlTesting
This change is