Skip to content

Sandcastle Reborn #12574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Sandcastle Reborn #12574

wants to merge 10 commits into from

Conversation

jjspace
Copy link
Contributor

@jjspace jjspace commented Apr 18, 2025

Description

Starting work on rebuilding Sandcastle. Currently this branch has the scrapped together hackathon code. This branch and PR will act as a staging branch for the work involved in the whole process. See #12566 for more details

  • Added a new package packages/sandcastle to encapsulate the new Vite + React + Typescript project
  • Set up the Vite build to output into Apps/Sandcastle2 (temporary path)
    • Running both the vite dev server and the static files from the normal CesiumJS dev server should behave the same. This requires a bit of extra config to make sure routes for assets and sample data line up. Should be working now but may require some finagling later if we change routes.

TODO:

  • Set up CI deployment

Issue number and link

Fixes #12566

Testing plan

From the top level

  • Run npm run build-sandcastle
  • Run npm start
  • Navigate to http://localhost:8080/Apps/Sandcastle2/index.html

From inside packages/sandcastle for direct development of sandcastle

  • Run npm run dev for the dev server build
  • Navigate to http://localhost:5173/

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

@jjspace jjspace requested a review from ggetz April 18, 2025 15:37
Copy link

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

@jjspace jjspace marked this pull request as draft April 18, 2025 15:43
@ggetz
Copy link
Contributor

ggetz commented Apr 24, 2025

Wahoo! @jjspace could you get this PR targeting to a feature branch for sandcastle v2? That way we can have smaller, iterative PRs as needed.

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great so far! I haven't reviewed any of the app code itself, since as I understand it is very much in flux. But I do have some thoughts on the overall configuration.

Comment on lines +66 to +67
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should all go into the dev dependencies for packages/sandcastle. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the nature of eslint after the "single top level flat-config" change these are actually used in the top level eslint.config.js so they do need to be dev dependencies of the whole repo AFAIK.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file built? Should it be it the .gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is here just because I had copied it for the hackathon project but it's not being used anymore. Will check and remove.

@@ -0,0 +1,203 @@
(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to modernize these functions and get them documented. Not sure where you're maintaining a TODO list, but that can get added in an iterative PR.

@@ -250,6 +250,11 @@ export async function buildTs() {
workspaces = packageJson.workspaces;
}

// TODO: we probably need to manage workspaces better now
workspaces = workspaces.filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to target workspace which are dependencies to avoid the manual filtering.

bucket = bucket.substring(pos + 1);
}

window.Sandcastle = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for Sandcastle-client.js.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to point this at the existing gallery directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as my other comment. I copied these for the hackathon and didn't remove them yet. They're not even referenced in the new app at all right now.

The whole gallery system might need a review of how we want to manage it so potentially a little in flux here too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I think we address the strategy around the gallery in a subsequent PR. Let's just get this initial one cleaned up in the meantime.

I started a TODO list if only for my own sanity. Please feel free to edit or move.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a built file, and should be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually not a built file right now. At the moment this is an array with the full code of each of the sandcastles I included in the project for the hackathon. it was just the quickest way I could get them in there without implementing the full parsing of how we're currently storing/loading the gallery. Definitely needs a review for how we're accessing them.

@jjspace
Copy link
Contributor Author

jjspace commented Apr 24, 2025

could you get this PR targeting to a feature branch for sandcastle v2? That way we can have smaller, iterative PRs as needed.

@ggetz I was expecting this branch/PR to be that feature branch. I was thinking of developing directly here until the build system is mostly sorted then do smaller PRs into this branch for review as needed. Where you thinking differently?

@ggetz
Copy link
Contributor

ggetz commented Apr 24, 2025

To keep things clean, let's target a new staging branch. That way we can merge this and keep the PR list tidy. Well... tidier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rebuilding Sandcastle: Technical Implementation
2 participants