Description
This issue will track the technical implementation of a new version of Sandcastle for CesiumJS. Design and features will primarily be worked out and discussed elsewhere. If you want to provide feedback on features you'd like to see please add them to our post on the community forum
High level plan
We plan to create a new workspace/package within our mono-repo to keep the new Sandcastle project separated but co-located with CesiumJS.
itwin-ui
: We expect to use the newest version of iTwin/Bentley UI library for both components and styling as much as possible. We may contribute improvements or components back to it as necessary.- React: This is a given if we want to make use of iTwinUI.
- Monaco: We'll want to balance robust feature set with usability for users who prefer a more minimal code editing experience. This should greatly increase the DX of the editor bringing familiarity for any already used to using VSCode
- TypeScript: Unless there is a reason not to. This will be isolated to it's own package so it's separate from the rest of CesiumJS
- Build tools: We'll likely get started with the Vite plugin for react, and if needed we can use esbuild like the CesiumJS library itself
As we build out the new version we plan to have a beta/dev deployment for people to test against. More info on this as build systems and CI get set up
Running task list
I will try to keep this updated going forward as the "source of truth" for both large and small tasks that are remaining
- re-evaluate gallery search (PageFind?)
- re-evaluate gallery system management
- nested gallery structure implemented, mostly based on this comment
- Migrate all existing sandcastles to the new structure (pushed a script to automate this to
gallery-conversion
branch) - Re-implement "new" detection for the gallery after the first release otherwise they will all show as new
- Previously based on
git diff
, see comment
- Previously based on
- Content pass on all sandcastles
- We may be able to cull a bunch of them. Others may need broken apart into multiple smaller ones
- Specifically many of the ones under the
development
directory seem to be old versions or duplicates of others we have and don't need anymore
- Specifically many of the ones under the
- Re-evaluate labels and consider actual categories
- We may be able to cull a bunch of them. Others may need broken apart into multiple smaller ones
- Code formatting command (added in Enable prettier formatter in monaco #12640)
- Monitor/update build system as needed (this is close but may still need a few adjustments)
- app build for top level use and types build missing comment
- finalize
eslint
config for new package files. First time TS and React is in there
- Finalize page title
- Currently has a temporary port number or
CI
, probably should include the sandcastle title if set? Possibly should include a hint at the environment that's running
- Currently has a temporary port number or
- Figure out how to display the version of CesiumJS and Sandcastle itself
- Integrate code generation "helpers" like "Add button" or "Add menu"
- I think this will use snippets so it's there for power users but doesn't clutter the UI?
need to investigatefirst iteration of snippets: Sandcastle helper snippets #12679 - Feedback that they're really useful
- I think this will use snippets so it's there for power users but doesn't clutter the UI?
- Finalize UI and implement new structure (design work tracked separately)
- Resizable panels (is there an easy library in react for this? Yes) Add resizing panels to Sandcastle #12672
- Add "User settings" stored in local storage.
- Theme, light/dark/system (Sandcastle using Stratakit #12731)
- Default starting panel, gallery or editor
- Editor settings - A subset of all available for Monaco
- Maaybe consider letting power users set the entire options object for monaco
- Firacode font instead of Droid Sans and Font Ligatures has specifically been requested
- Expand Sandcastle API
- Can we remove
knockout
dependency in all sandcastles? it may lead to users depending on it - Sliders are commonly needed
- Can we remove
- Implement console output (started in Sandcastle using Stratakit #12731)
- use for system messages too like missing types files or missing gallery files
- Consider if there's a "monitor value" type helper we can add to avoid spamming thousands of lines when wanting to track something that changes every frame
- Fix multiple arguments Sandcastle
console.log
does not behave properly with multiple arguments #11141 - Implement
console.debug
mirroring (I think this is the only one missing that we'd want to implement other than group and trace)
- Solidify and expand share capabilities. Currently just replaces the URL which is not ideal
- Consider a "one click" option to switch between prod and local environment (maybe only if we detect the local server?)
- Highlight editor lines for running sandcastle code and errors
- CSS only Stratakit for inside the bucket iframe
- If/How to handle multiple CesiumJS versions
- Consider Gist/Github integrations - re: saving, sharing, commenting, collaborating
- Set up deployment to dev environment Sandcastle dev deployment #12680
PRs for this effort
- Sandcastle Reborn #12574
- Fix Sandcastle local build #12603
- Sandcastle helpers class #12619
- Add standalone page to Sandcastle v2 #12620
- Sandcastle - Nested gallery structure #12631
- Solidify new Sandcastle React structure #12639
- Enable prettier formatter in monaco #12640
- Add resizing panels to Sandcastle #12672
- Sandcastle helper snippets #12679
- Sandcastle dev deployment #12680
- Sandcastle using Stratakit #12731
Follow up tasks
A list of ideas we've had that could benefit Sandcastle but will not be considered part of the initial re-build effort
- An "embed" version of Sandcastle like CodePen or JSFiddle have that we can use in our documentation. Minimal editor + viewer
CC @ggetz