Skip to content

Rebuilding Sandcastle: Technical Implementation #12566

Open
@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

  • 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
  • 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
    • Re-evaluate labels and consider actual categories
  • 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
  • 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 investigate first iteration of snippets: Sandcastle helper snippets #12679
    • Feedback that they're really useful
  • Finalize UI and implement new structure (design work tracked separately)
  • Add "User settings" stored in local storage.
  • Expand Sandcastle API
    • Can we remove knockout dependency in all sandcastles? it may lead to users depending on it
    • Sliders are commonly needed
  • Implement console output (started in Sandcastle using Stratakit #12731)
  • 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

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions