Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
20.96k stars 1.42k forks source link

Research Spike - Role Based Screens #816

Closed shogunpurple closed 3 years ago

shogunpurple commented 3 years ago

Design Doc here - https://www.notion.so/budibase/Role-Based-Screens-SPA-306cd428c98149de8185ea49522279d2

After a design meeting around role based screens, the best plan of action forward is to experiment with different approaches. The 2 that came out of the call:

Full Svelte App

This approach would involve creating a full blown svelte application from the screen and page JSON - essentially replacing the client library with svelte. We would leverage a svelte routing solution such as svelte-routing to manage navigation. This full svelte approach would require some kind of HMR or dev server when running inside the builder.

Server Render Dynamic Content Body with Svelte

Go to the server on every route to get the fully rendered HTML for the body of the screen based on the role of the user. Update the body of the app with the server rendered HTML.

Both of these approaches have merit - let's experiment with both and select one based on findings.

kevmodrome commented 3 years ago

Some thoughts and other stuff about full SPA/Routing:

Options considered:

The options I've looked at here are all, at least to me, valid routes to go down. There are some advantages and disadvantages to going each way.

Routify has a great a feature set (a ton of great helpers around navigating, transitioning etc) and the author is super helpful when it comes to any issues that pop up. As we all know it uses a file-based system but if that's something we want to avoid we can just hook straight into the routes manifest like I've written about in another issue specifically about the routing.

svelte-spa-router is very barebones and does what it tells you pretty much, we'd pick this if we want a barebones option.

SvelteKit is the obvious contender to the earlier options but there's not much information about it yet, although more is coming tomorrow when I'll be grilling Rich on the podcast about it 😬 The way it's supposed to work is very similar to Sapper but a bit more modular with different adapters depending on where you want to deploy your apps. this handles both the server and client side. Not too familiar with how the backend of budibase apps work but it might be something to explore when there's more information.

One big question is how we tie it all together. This is what would supplant the client library to get rid of all the hand-written render and state stuff so it needs to tie in nicely with the other parts, the server, "budibase-sdk" etc.

There's probably some stuff I've missed here, I'll add to it if/when there's more.

Edit: All the solutions discussed have some sort of HMR support and shouldn't be a problem to get working with some elbow grease.