plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.92k stars 1.85k forks source link

Inline maplibre css from node_modules #7140

Closed birkskyum closed 3 weeks ago

birkskyum commented 3 weeks ago

This pulls the css from nodemodules instead of unpkg. Mapbox traces inline the css, and doing so for maplibre as well will allow the map traces to run fully offline, ofc. at the cost of some bundle size.

Fixes #7139

This works for the dev server npm run start, but it might not yet get the .css inline in the build.

archmoj commented 3 weeks ago

@birkskyum Thanks very much for the PR. Is this PR ready for review?

birkskyum commented 3 weeks ago

Can you test if a build works, and not just the dev server?

archmoj commented 3 weeks ago

I see some changes to the bundle sizes in https://app.circleci.com/pipelines/github/plotly/plotly.js/11270/workflows/422af31b-c7fb-49f7-b06b-5e5c51081ea2/jobs/249307/parallel-runs/0/steps/0-108

But please double check.

Perhaps you may try using the basic partial build from the CircleCI artifatcs in a codepen like this?

archmoj commented 3 weeks ago

@birkskyum please add a draft log. Thank you!

birkskyum commented 3 weeks ago

i believe it's working now - i see the ~66kb ( size of the .css ) added to the bundle.

archmoj commented 3 weeks ago

Nicely revised. :dancer: