Releases: denchiklut/ssr-boilerplate
v4.0.0
What's Changed
- feat: logger by @denchiklut in #15
- feat: getENV by @denchiklut in #26
- feat/react-forget by @denchiklut in #19
Breaking changes
-
Since React code runs in two environments (client & server), it's easy to accidentally expose secrets to the client bundle. With this change, we have split environment variables into two main types: those that can be safely exposed to the client (prefixed with
CLIENT_
- u can change prefix inwebpack/plugins/define.plugin.ts
) and those that are strictly for server use.On the
client
,only
variables that start with theCLIENT_
prefix will be available, while on theserver
,all
environment variables are accessible. Additionally,getENV
willthrow
an error if anattempt
is made to accessserver-specific
environment variables in theclient
, ensuring that sensitive data remains secure.Important note!
Unlike with Next.js apps, environment variables in this setup arenot
baked into thebundle
atbuild
time. Thisallows
you tobuild
the apponce
(e.g., for staging) andreuse
the same build in other environments, such as production, without needing to rebuild for each environment. -
The
logger
has been updated to work seamlessly across bothserver
andclient
environments. On the server, it now uses theWinston
logger, while on the client, it falls back to thebrowser's console
, ensuring consistent logging behavior regardless of the environment. -
Also added the
React Forget
Babel plugin, which is an experimental feature designed forReact 19
(which has not yet been released). Since this is experimental, users can easily opt out of using it by removing the plugin from the.babelrc
configuration file if they encounter any issues or prefer not to use it at this time.
Full Changelog: v2.1.1...v4.0.0
SSR with React Suspense Api
Added examples with renderToPipeableStream
api
v2.1.1
- fixed webpack validation error
- update npm dependencies
v2.1.0
- setup PWA
- setup env utils
- setup debug util
v2.0.0
- fixed favicon issue
- setup webpack-dev-middleware
- update npm-run-all cli
- fix SPA warnings
- setup polifils