-
Notifications
You must be signed in to change notification settings - Fork 0
Description
What is this
This is a React framework inspired by the spring framework ecosystem.
It aims to work declaratively using decorators to mark 'parts' of the system with some behavior. For example, to declare a route returning a ReactELement you can do:
@Get('/users')
async UsersList({query}) {
let data = await queryUsers(query)
return <UsersListComponent data={data} />
}This is a basic example of how the framework will allow you to write code.
Core philosophy
The core philosophy is that the previous code should work in all react environments: CSR, SSR and RSC.
-
RSC: Using RSC, components may have
UseServerorUseClientto instruct the bundler to keep the files under a certain isolation. -
SSR: Full html (no js) and/or hydration. Depending on the mode, your component is rendered in the server and hydrated on the client.
-
CSR: It will be completely rendered on the client
Decorators
Framework API marking:
Resource: Routes will be inside this classConfiguration: Filters and config will be inside this class
Routing
The following decorators will be used to mark the decorated function as a router entry, they can customize the response type (text/html, application/json, stream, blob...)
GetPutPostPatchDeleteOptions
Behavior
Filter: will define a WebFilter that will be invoked at each routePreAuthorize: will prevent a user from rendering a component based on authorizations
Render
Render: says that we render a component, so the extraction will be to a.tsxfileUseServer: will be a RSCUseClient: will be a RCCLoading: will define the loading component when route is loadingErrorBoundary: will be rendered when an error occurs in the route elements
Context
Bean: will define a bean by nameInject: will allow injecting a bean by name
Bundling/transpilation
Here is how this will work after writing code:
-
@resource and @configuration will be scanned in the entire project
-
Routing will be deducted from the configured Resources
- Each route will be moved to its own file according to the decorators it has
- An entry point will be generated depending on the build target (csr, ssr or rsc)
(TO BE CONTINUED)

