Skip to content

feat: restrict sideEffects to CSS files in package.json#7258

Open
CommanderStorm wants to merge 1 commit intomaplibre:mainfrom
CommanderStorm:side-effects
Open

feat: restrict sideEffects to CSS files in package.json#7258
CommanderStorm wants to merge 1 commit intomaplibre:mainfrom
CommanderStorm:side-effects

Conversation

@CommanderStorm
Copy link
Member

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!

We are missing the sideEffects flag in our package-json, which means that bundlers currently have to be extra cautios when optimising us.
The *.css is something that we can likely also remove, but this is a bit unclear to me if they are actually side effect free
This is uneesseary and we can instead just let them optimise us.

I am putting this into v6 since it is fairly hard to predict if this is actually safe.
According to our tests it is, and we are not using side-effect ridden things in the main apis that I looked at (plus in the many more minor APIs that I let claude audit).

@CommanderStorm CommanderStorm added this to the 6.0 milestone Mar 13, 2026
@CommanderStorm CommanderStorm changed the title feat!: add sideEffects entry for CSS files in package.json feat!: restrict sideEffects to CSS files in package.json Mar 13, 2026
@CommanderStorm CommanderStorm changed the title feat!: restrict sideEffects to CSS files in package.json feat: restrict sideEffects to CSS files in package.json Mar 13, 2026
@HarelM
Copy link
Collaborator

HarelM commented Mar 13, 2026

I need to read about what this means, never saw it before. Thanks for taking the time to open this PR.

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.71%. Comparing base (f293c20) to head (55abb48).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7258   +/-   ##
=======================================
  Coverage   92.71%   92.71%           
=======================================
  Files         289      289           
  Lines       24074    24074           
  Branches     5112     5112           
=======================================
  Hits        22321    22321           
  Misses       1753     1753           

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants