BREAKING: disable runtime JS by default (#55)
This commit is contained in:
+10
-6
@@ -19,13 +19,17 @@ export interface PageProps {
|
||||
|
||||
export interface PageConfig {
|
||||
/**
|
||||
* Setting this flag to `false` disables all client side runtime JS. This
|
||||
* means that all interactivity on the client that depends on Preact or other
|
||||
* JS code will not function. This option is set to `true` (runtime javascript
|
||||
* is enabled) by default.
|
||||
* By default, runtime JS is disabled. This means that interactivity on the
|
||||
* client that depends on Preact or other JS code will not function.
|
||||
*
|
||||
* It is recommended to disable runtime JavaScript for static pages that do
|
||||
* not require interactivity, like marketing or blog pages.
|
||||
* Runtime JS can be enabled by setting `runtimeJS` to `true`.
|
||||
*
|
||||
* It is recommended to keep runtime JavaScript disabled for static pages that
|
||||
* do not require interactivity, like marketing or blog pages.
|
||||
*
|
||||
* Note that the runtime JS feature will likely be overhauled in the future to
|
||||
* provide more granular control over which components need to be hydrated on
|
||||
* the client.
|
||||
*/
|
||||
runtimeJS?: boolean;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export class ServerContext {
|
||||
name,
|
||||
component,
|
||||
handler,
|
||||
runtimeJS: config?.runtimeJS ?? true,
|
||||
runtimeJS: config?.runtimeJS ?? false,
|
||||
};
|
||||
pages.push(page);
|
||||
} else if (
|
||||
|
||||
Reference in New Issue
Block a user