Skip to content

Conversation

@cyyynthia
Copy link
Contributor

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

Description

This PR tweaks the way shareable URLs are being generated and parsed, to make the "shareable" data parameter smaller. Taking the shareable used in #6065, the URL is ~5.4kB without this change and ~3.7kB with the change.

Reduction is achieved by not URI-encoding the JSON object, instead opting to turn the base64 string into the base64url variant. There is a check to detect URI-encoded shareables to make the change fully backwards compatible with all the REPL links in the wild.

@vercel
Copy link

vercel bot commented Sep 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rollup Ready Ready Preview Comment Sep 5, 2025 0:45am

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Good thinking! To be honest, I never considered looking into optimizations here, it has probably been like this forever.

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install cyyynthia/rollup#shorter-shareables

Notice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust.

or load it into the REPL:
https://rollup-iyxfv4bl1-rollup-js.vercel.app/repl/?pr=6088

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

Performance report

  • BUILD: 6884ms, 832 MB
    • initialize: 0ms, 25 MB (+8%)
    • generate module graph: 2572ms, 633 MB
      • generate ast: 1387ms, 622 MB
    • sort and bind modules: 393ms, 693 MB
    • mark included statements: 3922ms, 832 MB
      • treeshaking pass 1: 2299ms, 828 MB
      • treeshaking pass 2: 460ms, 818 MB
      • treeshaking pass 3: 393ms, 833 MB
      • treeshaking pass 4: 383ms, 823 MB (+3%)
      • treeshaking pass 5: 379ms, 832 MB
  • GENERATE: 797ms (+108ms, +15.7%), 919 MB (-6%)
    • initialize render: 0ms, 845 MB (-6%)
    • generate chunks: 232ms (+188ms, +420.0%), 822 MB (-7%)
      • optimize chunks: 0ms, 860 MB (-2%)
    • render chunks: 631ms (+14ms, +2.3%), 901 MB (-6%)
    • transform chunks: 21ms, 919 MB (-6%)
    • generate bundle: 0ms, 919 MB (-6%)

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.79%. Comparing base (298609e) to head (f94e3a3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6088   +/-   ##
=======================================
  Coverage   98.79%   98.79%           
=======================================
  Files         271      271           
  Lines       10622    10622           
  Branches     2840     2840           
=======================================
  Hits        10494    10494           
  Misses         88       88           
  Partials       40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert lukastaegert added this pull request to the merge queue Sep 5, 2025
Merged via the queue into rollup:master with commit a2744ea Sep 5, 2025
98 of 102 checks passed
@cyyynthia cyyynthia deleted the shorter-shareables branch September 5, 2025 19:27
@github-actions
Copy link

github-actions bot commented Sep 7, 2025

This PR has been released as part of [email protected]. You can test it via npm install rollup.

@joaoninguemgostoso-code

This PR contains:

* [ ×]  bugfix

* [× ]  feature

* [ ]  refactor

* [x]  documentation

* []  other

Are tests included?

* [× ]  yes (_bugfixes and features will not be merged without tests_)

* []  no

Breaking Changes?

* [× ]  yes (_breaking changes will not be merged unless absolutely necessary_)

* []  no

Description

This PR tweaks the way shareable URLs are being generated and parsed, to make the "shareable" data parameter smaller. Taking the shareable used in #6065, the URL is ~5.4kB without this change and ~3.7kB with the change.

Reduction is achieved by not URI-encoding the JSON object, instead opting to turn the base64 string into the base64url variant. There is a check to detect URI-encoded shareables to make the change fully backwards compatible with all the REPL links in the wild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants