Skip to content

cesium vite experiments #12581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jfayot
Copy link
Contributor

@jfayot jfayot commented Apr 23, 2025

Description

This PR is an experimental approach to tackle different subjects through the creation of an additional package @cesium/utils (I realize that it could be renamed @cesium/utility to match cesium native component):

  • Continue further splitting of @cesium/engine into smaller packages
  • Start Typescript migration into an iterative way on a per package basis
  • Use Vite as a build tool to manage Browser / Node outputs

For the moment, only a few files have been moved to the new package @cesium/utils:

  • defer.js
  • defined.js / d.ts
  • Check.js / d.ts
  • DeveloperError.js
  • RuntimeError.js
  • Fullscreen .js
  • FeatureDetection.js

Corresponding Specs have been moved too, but unit test FeatureDetection / "detects WebGL2 support" had to be removed as it pulled unwanted dependency Scene.

There have been some imports reordering during the process, which makes quite a lot of modified files. This is because I temporarily used organize-imports-cli. This could be added as a lint-stage.

For the documentation generation, I'm still using jsdoc comment headers, but as it is with typescript files, I had to use the jsdoc-babel plugin. It works quite well, and allows to keep consistent doc across js and ts. But it could be interesting to evaluate other tools such as typedoc which are specifically made for typescript.

For the declaration types, I'm using the one bundled by dts vite plugin, and then inserting it at the end of Cesium.d.ts (see function createTypeScriptDefinitions).

If this approach is something you'd like to continue with, let me know, so that we can agree on what to put inside @cesium/utils, and help me identify what's missing in the build / ci scripts (for instance debug pragma strip out...)

Issue number and link

Addresses following issues:

Testing plan

  • All tests should still pass
  • ESLint should be OK
  • Documentation generation OK with new @cesium/utils section
  • make-zip should be OK
  • build-ts should be OK
  • build-release should be OK

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @jfayot!

✅ We can confirm we have a CLA on file for you.

@jfayot jfayot changed the title added @cesium/utils cesium vite experiments Apr 23, 2025
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.

1 participant