Open
Description
CesiumJS is an extensive library with a lot of functionality that, depending on the app or use case, goes unused. Installing the cesium
npm package also syncs third party libraries which may go unused. All features are tied to the monthly Cesium versioning, whether or not anything has changed.
Many users should continue to use the "traditional" CesiumJS releases, but there are also many use cases that would benefit from ingesting smaller, more specific packages.
See this community forum thread for some seeds of this discussion.
- Maintain the traditional combined release as before. There may be some internal refactoring, but from an end user standpoint, the
cesium
npm package and release would remain as-is - Maintain all code from within the same repo. We don't want to introduce additional development burden with additional repos or submodules
- workspaces are built into npm for use cases such as this. It allows dependency management to work similar to before with all modules installed to one top-level
node_modules
directory - All packages would continue to share the same tooling
- workspaces are built into npm for use cases such as this. It allows dependency management to work similar to before with all modules installed to one top-level
- Publish individual packages along architectural boundaries. In theory, there should be nothing stopping us from breaking up and publishing code as-is with some additional configuration, however due to some interconnections in the architecture, this may require some refactoring so that we are not "cheating" by using private APIs.
- Each new package would be able to be published individually
- Each new package would only require relevant dependencies-- This means dependencies would only be synced if they are strictly needed, rather than the approach we take now where all dependencies are installed regardless
- Each new package would follow semver, while traditional CesiumJS release could remain with its monthly versioning strategy
- Most major JS projects implement a variation of this (React, Babel, BabylonJS, Angular…)
- While not needed for an initial implementation, eventually, this could allow us take advantage of tooling for dependency graphs and more, allowing us to do things like run only the unit tests relevant to a change
- lerna is a tool recommended by npm for managing monorepos, also nx for more advanced use cases
A few use cases:
- Widgets
CesiumViewer
and other Widgets work well for simple use cases that want to get something really basic up quickly. But a more sophisticated app does not need them, and they can actively be a hindrance as they bring in many static assets.- Separating widgets would isolate the dependency on knockout, which is generally incompatible with other UI/Component stacks, and itself can be a security issue. Notably, the basic
CesiumWidget
does not rely on knockout.
- Core/Math
- Could be used by gltf-pipeline, where we depend on CesiumJS for utilities but don’t use it for rendering (gltf-pipeline is also a dependency back in CesiumJS, which is currently a circular dependency).
- KML, GeoJson/TopoJson, and Google Earth support each rely on specific dependencies that are not used elsewhere in the API