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
Currently, all non-segmented modules share state with all segments running on the same worker node. This setup simplifies the use of shared resources, such as the database. However, since most modules do not (and should not!) maintain state, we propose adding a configuration option to enable or disable state sharing.
For the separation, we will use the following terminology:
shared: modules that share state
common: modules that do NOT share state
In summary, the following steps need to be taken:
Set all non-segmented imports to be common by default.
Explicitly define shared imports for each segment.
To achieve the first goal, we need to replace dynamic imports with static imports. For the second goal, we need to introduce an additional access level, "shared", to indicate a shared import. For example:
Currently, all non-segmented modules share state with all segments running on the same worker node. This setup simplifies the use of shared resources, such as the database. However, since most modules do not (and should not!) maintain state, we propose adding a configuration option to enable or disable state sharing.
For the separation, we will use the following terminology:
In summary, the following steps need to be taken:
To achieve the first goal, we need to replace dynamic imports with static imports. For the second goal, we need to introduce an additional access level, "shared", to indicate a shared import. For example:
[name].segment.json
Modules with "shared" access will be imported dynamically to ensure they are excluded from the bundling process.
The text was updated successfully, but these errors were encountered: