-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 New sandcastle title and dirty state tracking #12794
- 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
- Warning for leaving the page with "unsaved" changes New sandcastle title and dirty state tracking #12794
- 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 Sandcastle popovers #12832
- Settings modal Add Sandcastle settings #12819
- Clicking demo from gallery should load demo but not switch, add dedicated button to switch to code instantly
- Add a link to the ref-docs on the page, maybe in the sidebar Sandcastle docs link #12834
- Do a final pass on the app's CSS, all classes used, stratakit-vars where I can, logical structure and no "bleeding" styles Stratakit css cleanup #12802
- Fix "Open code" button not working on an already loaded sandcastle Always switch to editor when it should #12820
- CSS only Stratakit for inside the bucket iframe Stratakit css cleanup #12802
- Add share details modal with the share URL to copy. Feature parity with what's in the current version Sandcastle popovers #12832
- Improvements to sharing as a whole will be a follow up task
- Add "User settings" stored in local storage. Add Sandcastle settings #12819
- 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? Add Sandcastle settings #12819
- 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 comment
- Fix multiple arguments Sandcastle
console.log
does not behave properly with multiple arguments #11141 - Implement "stay scrolled" ourselves? (from comment)
- verify performance of mirroring, I noticed it starting to lag a little when testing logs every frame
- Support loading URLs with a
gist
id in them for legacy urls that may still be out there Add support for loading GH Gist urls #12833 - Improve gallery search to include titles and descriptions. @ggetz was working on this after the initial search was implemented Sandcastle search and filtering updates #12854
- 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
- Some work on this done in Sandcastle metadata cleanup #12865
- Refine gallery "filter by label" presentation. We discussed having these be clickable pills so all labels are visible from the start
- Remove Viewerless sandcastle if we deem it's not necessary anymore
- Clean up styles for toolbars to make them consistent Consolidate toolbar styles for all sandcastles #12848
- We may be able to cull a bunch of them. Others may need broken apart into multiple smaller ones
- Create structured plan to transition from current Sandcastle to the new one
- The plan is to deploy the new to
dev-sandcastle.cesium.com
and point people to the new one, have both up for a bit with the old as default, Swap the default to the new with the old accessible for a period, then finally only provide the new one. - Determine if we want to push out intermittent releases for sandcastle only during the month of September, could be nice to respond to bugs quicker
- Ideally not but will play it by ear
- The plan is to deploy the new to
- Update CI to work in the
cesium.com
branch Sandcastle cross links #12855 - Add "Try new sandcastle" message to "old" sandcastle Sandcastle cross links #12855
- Add "Return to sandcastle" message to "new" sandcastle Sandcastle cross links #12855
- Is there a way to link between the two using the share urls to preserve work?
- No, not easily. Forward is fine, backward is not. see comment in Sandcastle cross links #12855
- Is there a way to link between the two using the share urls to preserve work?
- Add feedback/bugs notice to new sandcastle before deployment Sandcastle cross links #12855
Post initial release:
- Follow up from gallery search improvements @ggetz Sandcastle search and filtering updates #12854
- Part of this may be a discussion around the gallery structure and how it's imported into the app itself
- Add version info to Sandcastle for updates
- Add "New features" type info panel for important releases? Maybe not necessary if it doesn't change much?
- Highlight editor lines for running sandcastle code and errors
- Expand Sandcastle API
- Document the API itself, static page or overlay in Sandcastle?
- Sliders are commonly needed
- 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
- Insert snippets at cursor Stratakit css cleanup #12802 (comment)
- Prevent "Loading" message from jumping around Stratakit css cleanup #12802 (comment)
- I've tried multiple things to mitigate this but I think it's still down to some sort of FOUC or resizing of the panels on page load or something weird. Might be worth moving the "Loading" message back to the top left so it doesn't rely on styles for positioning
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
- New sandcastle title and dirty state tracking #12794
- Stratakit css cleanup #12802
- Add Sandcastle settings #12819
- Always switch to editor when it should #12820
- Sandcastle popovers #12832
- Add support for loading GH Gist urls #12833
- Sandcastle docs link #12834
- Consolidate toolbar styles for all sandcastles #12848
- Sandcastle cross links #12855
- Sandcastle search and filtering updates #12854
- Sandcastle metadata cleanup #12865
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
- Some discussion in this thread New sandcastle title and dirty state tracking #12794 (comment)
- Add a "Whats new" item to the sidebar to include update notes
- Consider option for "dropdown" or alternative from gallery card to "preview" code and provide more context
CC @ggetz