-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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?) New Gallery search for sandcastle #12755
- re-evaluate gallery system management
- nested gallery structure implemented, mostly based on this comment
- Migrate all existing sandcastles to the new structure (script to automate this added in Gallery conversion for Sandcastle v2 #12752)
- Code formatting command (added in Enable prettier formatter in monaco #12640)
- 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
- Included in a dropdown in Sandcastle using Stratakit #12731, I think this works for now.
- I think this will use snippets so it's there for power users but doesn't clutter the UI?
- Set up deployment to dev environment Sandcastle dev deployment #12680
- 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 - Use title of loaded gallery demo for now, drop CI to "hide" it
- Currently has a temporary port number or
- Figure out how to display the version of CesiumJS and Sandcastle itself
- Cesium version in top right seems nice so far, sandcastle version could be in the settings modal
- 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
- Feedback forum thread https://community.cesium.com/t/redesigning-sandcastle-requesting-feedback/41981/4
- Sandcastle using Stratakit #12731
- Clicking the title shows metadata information
- Settings modal
- Clicking demo from gallery should load demo but not switch, add dedicated button to switch to code instantly
- Consider option for "dropdown" from gallery card to "preview" code
- Add a link to the ref-docs on the page, maybe in the sidebar
- Do a final pass on the app's CSS, all classes used, stratakit-vars where I can, logical structure and no "bleeding" styles
- CSS only Stratakit for inside the bucket iframe
- Add share details modal with the share URL to copy. Feature parity with what's in the current version
- Improvements to sharing as a whole will be a follow up task
- Add "User settings" stored in local storage.
- Theme, light/dark/system (Sandcastle using Stratakit #12731)
- 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
- Default starting panel, gallery or editor?
- Default to gallery unless loading a specific example id or share key
- Dedicated URL like
index.html?new
- can we make it selectible in the settings?
- Implement console output (started in Sandcastle using Stratakit #12731)
- use for system messages too like missing types files or missing gallery files
- Fix delayed output from hitting the logs after re-running
- Fix multiple arguments Sandcastle
console.log
does not behave properly with multiple arguments #11141 - Implement "stay scrolled" ourselves? Sandcastle using Stratakit #12731 (comment)
- verify performance of mirroring, I noticed it starting to lag a little when testing logs every frame
- Warning for leaving the page with "unsaved" changes
- Support loading URLs with a
gist
id in them for legacy urls that may still be out there - Expand Sandcastle API
- Document the API itself, static page or overlay in Sandcastle?
- Sliders are commonly needed
- Highlight editor lines for running sandcastle code and errors
- 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 - Maybe instead have a "addedIn" value in the sandcastle metadata instead of diff
- Previously based on
- Monitor/update build system as needed (this is close but may still need a few adjustments)
- Ensure we have a system for building against an arbitrary gallery location
- Consider if
vite
is necessary or we'd be better off withesbuild
directly- Verify how we're "building" cesium into the build, maybe we can point at a different path instead of copying built files.
- Document and solidify build process from the repo root (related: comment)
- finalize
eslint
config for new package files. First time TS and React is in there
- 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
- Remove Viewerless sandcastle if we deem it's not necessary anymore
- We may be able to cull a bunch of them. Others may need broken apart into multiple smaller ones
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
- Gallery conversion for Sandcastle v2 #12752
- New Gallery search for sandcastle #12755
- Load monaco from packages not CDN #12760
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
- Full Documentation integration
- The better intellisense helps a lot but currently don't have a way to open the docs fully like before. Maybe we just recommend a second tab to people?
- Allow loading multiple CesiumJS versions
- Expand Gist/Github integrations - re: saving, sharing, commenting, collaborating
- Can we remove
knockout
dependency in all sandcastles? it may lead to users depending on it - "Value monitor" type helper we can add to avoid spamming thousands of lines when wanting to track something that changes every frame for the console
- Implement
console.debug
mirroring (I think this is the only one missing that we'd want to implement other than group and trace) - Expand share capabilities, what is saved, what is shared, how do things get shared
- Is there an alternative "download" we can offer with the files that can be "dropped" back into sandcastle
- Consider a "one click" option to switch between prod and local environment (maybe only if we detect the local server?)
- Save previous "successful" runs of a sandcastle to recover from crashes
CC @ggetz