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

feat: update to rollup 4 #1370

Merged
merged 21 commits into from Jan 11, 2024
Merged

feat: update to rollup 4 #1370

merged 21 commits into from Jan 11, 2024

Conversation

diegopf
Copy link
Contributor

@diegopf diegopf commented Dec 19, 2023

This PR updates rollup to the latest version which will help us in the transition from rollup to vite in the future.

The biggest changes are:

  1. Convert configuration files to ES modules
  2. Changes to rollup options
  3. Different file name pattern

In order to test this changes you should make a pnpm install --frozen-lockfile which will trigger the build for every package in the monorepo with the new rollup version. Afterwards, you can use the archetype and install locally the new versions and see if everything is still working as expected.

@diegopf diegopf requested a review from a team as a code owner December 19, 2023 11:00
@@ -30,7 +30,7 @@
"./tests/**/*",
"**/*.scss",
"**/*.scss.js",
"**/*vue_styles.*.vue.js",
"**/*vue[0-9].js",
Copy link
Contributor Author

@diegopf diegopf Dec 19, 2023

Choose a reason for hiding this comment

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

Due to how rollup generates now the output filenames when preserving modules, we need to adjust the sideEffect field in the package.json so bundlers do not tree shake styles of vue components.

The rollup-plugin-vue splits every vue sfc into two virtual files. Taking for example the redirection.vue component:

redirection.vue?rollup-plugin-vue=script.ts
redirection.vue?rollup-plugin-vue=styles.0.css

Prior to v3 rollup generates three files:
redirection.vue.js
redirection.vue_rollup_plugin-vue_script.vue.js
redirection.vue_rollup_plugin-vue_styles.0.js.

However, now rollup will name those files:
redirection.vue.js
redirection.vue.2.js
redirection.vue.3.js

You can see a simple example using the rollup repl

Rollup 2.79.1 filenames

Rollup 4.9.1 filenames

@annacv
Copy link
Contributor

annacv commented Dec 20, 2023

@diegopf great job!!

Tested in archetype & everything is working fine. The warnings mentioned don't break the build process.

Here is just a minor doubt I have:

@diegopf diegopf requested a review from annacv December 22, 2023 08:49
Copy link
Contributor

Choose a reason for hiding this comment

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

iep! We forgot this one!
output: [{ format: 'esm', dir: resolve(__dirname, '../showcase'), preserveModules: true }],

annacv
annacv previously approved these changes Dec 22, 2023
Copy link
Contributor

@annacv annacv left a comment

Choose a reason for hiding this comment

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

🎉

Tested x-components library
Tested x-tailwind library
Tested all inside archetype

Just found some warns in x-types, which are not new nor related to this task (so these should be handled in another task -small-)

All fine 💯

lauramargar
lauramargar previously approved these changes Dec 29, 2023
Copy link
Contributor

@lauramargar lauramargar left a comment

Choose a reason for hiding this comment

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

🚀

@annacv annacv dismissed stale reviews from lauramargar and themself via 65e95b3 January 2, 2024 13:40
@annacv annacv merged commit a5c471b into main Jan 11, 2024
4 checks passed
@annacv annacv deleted the feat/update-rollup-versions branch March 26, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants