Skip to content

Rebuilding Sandcastle: Technical Implementation #12566

@jjspace

Description

@jjspace

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

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
  • 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

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
  • 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions