Inline Static Assets in Builds
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 15.8k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
The current CesiumJS distribution consists of a single, bundled JS entry point, Cesium.js, which inlines all library JS code. It also ships with several other static files, including standalone Worker JS files, third party wasm files, JSON data, images/textures, and CSS files. Depending on what features of the library is being used, some or all of these static files are required to be loaded at runtime.
While we've operated with these static files as part of the distribution since the beginning, it can require extra infrastructure on the part of developers depending on CesiumJS. We'd like to re-evaluate our strategy and look into providing a single-file CesiumJS distribution
As a first step, we could allow an optional inline flag as part of the build script. esbuild has a loader option which allows other file types besides JS to be inlined most likely as data urls.
After ensuring everything works, we should put some thought into potentially shipping by default as part of the release zip.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the build script and its esbuild configuration, then review the loader option for the standalone Worker files, wasm files, JSON data, images/textures, and CSS files described in the issue. Check whether an optional inline flag can produce a working single-file distribution, and verify the result before considering how it could fit into the release zip.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100