You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The framework will analyze all route components and retrieve the pageConfigexport, regardless of whether the application is configured as SPA. The purpose of extracting pageConfig from each route component is to modify the initial HTML generated by the document, including elements like title and meta.
However, when it comes to SPA configurations, updating the initial HTML with pageConfig isn't necessary, as there is often a separate server dedicated to serving HTML. Additionally, the compilation process for pageConfig tends to result in errors due to certain pieces of code and dependencies that are incompatible with Node.js.
Furthermore, this additional compilation step can significantly hinder the development velocity of the framework by introducing extra complexity and processing time.
Usage example | 使用示例
No response
Detailed design | 方案设计
The compilation step for routes-config.bundle.mjs will be eliminated to address concerns in two specific scenarios:
SPA : The initial HTML will not be dynamically updated with route-specific pageConfig prior to client-side rendering. Instead, it will be updated once the client bundle has been executed and the application is running in the browser.
SSR / SSG : The initial HTML will indeed be updated with pageConfig derived directly from the route components' configurations during server-side execution or static site generation.
To accommodate cases where custom plugins need access to a specific route's configuration, such as PHA plugin, the framework will continue to provide an API named getRoutesConfig. This ensures that while direct compilation is removed to streamline processes, essential route configuration information remains accessible as needed.
Additional context | 额外信息
For apps configured as SPA, the pageConfig will not be applied to update the HTML. Developers who need to customize the initial HTML structure can directly modify the document.tsx file to implement the required configurations.
The text was updated successfully, but these errors were encountered:
Summary | 概述
No response
Motivation | 背景
The framework will analyze all route components and retrieve the pageConfigexport, regardless of whether the application is configured as SPA. The purpose of extracting pageConfig from each route component is to modify the initial HTML generated by the document, including elements like title and meta.
However, when it comes to SPA configurations, updating the initial HTML with pageConfig isn't necessary, as there is often a separate server dedicated to serving HTML. Additionally, the compilation process for pageConfig tends to result in errors due to certain pieces of code and dependencies that are incompatible with Node.js.
Furthermore, this additional compilation step can significantly hinder the development velocity of the framework by introducing extra complexity and processing time.
Usage example | 使用示例
No response
Detailed design | 方案设计
The compilation step for routes-config.bundle.mjs will be eliminated to address concerns in two specific scenarios:
To accommodate cases where custom plugins need access to a specific route's configuration, such as PHA plugin, the framework will continue to provide an API named getRoutesConfig. This ensures that while direct compilation is removed to streamline processes, essential route configuration information remains accessible as needed.
Additional context | 额外信息
For apps configured as SPA, the pageConfig will not be applied to update the HTML. Developers who need to customize the initial HTML structure can directly modify the
document.tsx
file to implement the required configurations.The text was updated successfully, but these errors were encountered: