Server Side Rendering: Mark files as 'SSR-ready', and warn if they're modified #1594
Labels
[Feature Group] Appearance & Themes
Features related to the appearance of sites.
Framework
Server Side Rendering
[Type] Task
Milestone
In order to remove
shared
, and provide visibility on which modules in the codebase are compatible with SSR, we should provide some way of marking files with some form of pragma, e.g./* @ssr-ready */
.The reason for the pragma, instead of a plain old comment, is so we can programatically ensure that modifications to these files don't violate any SSR constraints, and provide feedback if they do.
The pragma approach could also be extended into other scenarios, such as
/* @react-native-ready */
.There are a couple of ways I can think of to do this:
npm
modules. The main benefit is that we can exit themake run
process, or provide warnings in the browser. We could also specify any modules we'd like to 'stub' in the pragma for SSR.eslint
plugin to enforce some rules, or a separate script, which would be run on commit. This would take the burden off the build process, but we may lose some flexibility without access to the dependency graph. It could also be less visible, as certain git clients or IDEs may not show the pre-commit messages.The text was updated successfully, but these errors were encountered: