We are currently using a Constructor based API for initializing the adapter. This is great since all the config is in one place, but it has drawbacks. Mainly that it can't be automatically tree-shaken.
One of paraglide's main advantages is that it's small. The Adapters should be very slim on the client to keep that advantage.
Proposal
Implement the following steps:
✅ Split up API to allow for better Tree-Shaking while still keeping config central (like PARJS-73)
✅ Use the react-server export condition to avoid shipping code that isn't needed outside of server components. (created rsc-env utility package to help here)
✅ Simplify and minify code wherever opportunities are seen
Context
We are currently using a Constructor based API for initializing the adapter. This is great since all the config is in one place, but it has drawbacks. Mainly that it can't be automatically tree-shaken.
One of paraglide's main advantages is that it's small. The Adapters should be very slim on the client to keep that advantage.
Proposal
Implement the following steps:
react-server
export condition to avoid shipping code that isn't needed outside of server components. (createdrsc-env
utility package to help here)