[RFC] Toolpad folder layout #1817
Replies: 3 comments 3 replies
-
Update from weekly meeting. This is what we'll go with for now:
|
Beta Was this translation helpful? Give feedback.
-
Does having a folder for pages allow me to have 2 or more pages in a folder? I mean, if it's a folder it can have more files, so what kind of files it can have? Users will try shifting a function.ts or a component.tsx to this folder to see what happens. So just want to ensure having folder (just for pages) is not a footgun. |
Beta Was this translation helpful? Give feedback.
-
I am closing it as we have a decent folder structure now. |
Beta Was this translation helpful? Give feedback.
-
What's the problem? 🤔
Toolpad wants to enable pro-code editing on its data model. Currently the datamodel lives in files inside of a
./toolpad/
folder. We should provide a more ergonomic layoutWhat are the requirements? ❓
What are our options? 💡
Option 1. Grouping by function
Create top level folders for pages/components/queries.
Drawbacks:
Option 2. Use file extensions to identify objects
Drawbacks:
Option 3. Use folders to represent pages
Advantages:
queries.ts
files leave room for the user to organize their queries however they want. e.g. put them all in the same file, or use a barrel file to re-export queries from separate.ts
filesDrawbacks:
components
subfolder without it clashing with sub pages)Option 4. Use folders + file extensions
Advantages:
getUsers.query.yml
to represent a query authored by a visual editorDisadvantages
Proposed solution 🟢
Options 3. but with a global
pages
folderResources and benchmarks 🔗
No response
Beta Was this translation helpful? Give feedback.
All reactions