Skip to content
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

Revamp toolpad file system layout #1831

Merged
merged 43 commits into from
Apr 12, 2023
Merged

Revamp toolpad file system layout #1831

merged 43 commits into from
Apr 12, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 29, 2023

Closes #1431
Closes #1817

  • It gets the job done by converting the new file format to the old Toolpad app DOM and running Toolpad on that. It's a bit hacky and has a few rough edges that can't be solved in this setup, but the alternative is a big rewrite. We can rewrite piece by piece this way, but already enjoy the new pages folder.
  • Use ./pages/<name>/page.yml to store page configuration
  • Using zod schemas to validate configuration
  • Simplify the datastructure:
    • Make most properties optional, to have it as light as possible
    • Expand the nodes to have a hierarchical structure instead of the flat list of nodes linked by ids
    • Simplify bindings. const values will just be the javascript primitive. Bindings will be an object with { $$jsExpression : '...' }.
  • ./.toolpad-generated/ folder moved to ./toolpad/.generated/
  • ./.toolpad-generated/.gitignore moved to ./toolpad/.gitignore
  • ./toolpad/queries.ts moved to ./toolpad/resources/functions.ts
  • added ./toolpad/theme.yml

To Do

  • Nest ./queries.ts in these folders
  • Query bindings
  • ids are constantly being regenerated, resulting in UI losing selection constantly, amongst other weird problems
  • Initialization is brittle and has lots of corner cases. Migrations start to become more and more complex and I'm thinking of making this more explicit. e.g.:
    • If toolpad config version < installed toolpad version: Show message "Please run npx toolpad migrate to upgrade the project"
    • If toolpad config version > installed toolpad version: Show message "Please upgrade toolpad"
    • Add explicit CLI command npx toolpad migrate that migrates the project to the currently installed version
  • Add version and kind fields

@Janpot Janpot added the core Infrastructure work going on behind the scenes label Mar 29, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 30, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 30, 2023
@Janpot Janpot changed the title Pages folder [WIP] Update toolpad folder layout Apr 5, 2023
@Janpot Janpot changed the title Update toolpad folder layout Revamp toolpad file system layout Apr 5, 2023
@Janpot Janpot marked this pull request as ready for review April 5, 2023 11:40
@Janpot Janpot enabled auto-merge (squash) April 12, 2023 07:45
@Janpot Janpot merged commit f4ca722 into master Apr 12, 2023
@Janpot Janpot deleted the pages-folder branch April 12, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No easy way to combine pages from 2 different apps
1 participant