Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/discussion 1117 Isolation Mode (v1) #1206

Merged
merged 5 commits into from
Mar 10, 2024

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Feb 27, 2024

Related Issue

#1117 (somewhat restores - #1110)

Introduces Worker threads as part of the greenwood serve lifecycle when expressed through the a file level export enabling it, which will ensure the page does not get executed in the global scope of the NodeJS process.

// src/pages/products.js
export const isolation = true;

This aims to help address various issues observed with trying to support DOM shims on the server

Summary of Changes

  1. Add opt-in / out isolation mode for SSR pages and add test case
  2. Add opt-in / out isolation mode for API routes and add test case
  3. Default Settings
    • WCC - false
    • Lit - true
  4. Added global configuration for isolation mode
  5. Add documentation and test cases

TODO

  1. Add global configuration option
  2. Docs
    • configuration docs
    • SSR route docs
    • API docs
    • Data sources / graph docs? - N / A
    • adapters / execute route module for export const isolation = true - N / A
  3. Finalize default settings for plugins and docs
    • WCC - false
    • Lit - true
  4. Clean up console logs / comments
  5. refactoring (nice to have)
    • ssr-route-worker filenames are a little clunky
    • Should we re-use thread pool? - maybe?
      • actually no, we should let user's decide on how to scale their own servers, we shouldn't cap anything in production
    • get more options from the graph / module instead upfront instead of in execute route module - will save for eliminate SSR page instantiation during graph lifecycle #991

Question

  1. Should it be set to true by default?

@thescientist13 thescientist13 added question Further information is requested documentation Greenwood specific docs Plugins Greenwood Plugins CLI SSR feature New feature or request labels Feb 27, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Feb 27, 2024
@thescientist13 thescientist13 self-assigned this Feb 27, 2024
@thescientist13 thescientist13 changed the title feature/1117 Isolation Mode for greenwood serve feature/1117 Isolation Mode Feb 27, 2024
@thescientist13 thescientist13 changed the title feature/1117 Isolation Mode feature/1117 Isolation Mode (v1) Feb 27, 2024
@thescientist13 thescientist13 changed the title feature/1117 Isolation Mode (v1) feature/discussion 1117 Isolation Mode (v1) Feb 27, 2024
@thescientist13 thescientist13 changed the base branch from master to release/0.30.0 March 9, 2024 20:07
@thescientist13 thescientist13 mentioned this pull request Mar 9, 2024
37 tasks
@thescientist13 thescientist13 added breaking and removed question Further information is requested labels Mar 10, 2024
@thescientist13 thescientist13 merged commit 55f36b7 into release/0.30.0 Mar 10, 2024
8 checks passed
@thescientist13 thescientist13 deleted the feature/1117-isolation-mode-v1 branch March 10, 2024 00:30
thescientist13 added a commit that referenced this pull request Jun 1, 2024
* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 2, 2024
* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 2, 2024
* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 2, 2024
* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 22, 2024
* feature/discussion 1117 Isolation Mode (v1) (#1206)

* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin

* enhancement/Issue-1118: Single File Bundles for SSR and API routes (#1186)

* Issue-1118: Refactor rollup config generation for APIs

* Issue-1118: Refactor rollup config generation for SSR

* Issue-1118: Refactor forEach to use for-in for the ssr config generation

* Issue-1118: Convert forEach to for..in

* Issue-1118: Remove unused code

* refactor away bundling work arounds and add comments

* refactor SSR page bundling to avoid hacky entry point placeholder hack

* patch custom element registry check from wcc

* refactor SSR page output name from .entry to .route

* document breaking changes for adapter plugins

* refactor import meta relative asset path escaping

* refactor API routes and adapters for mapped API bundles

* misc refactoring and docs update

* latest WCC patches

* windows compatibility

* update adapter docs example

* remove patches

---------

Co-authored-by: Owen Buckley <owenbuckley13@gmail.com>

* v0.30.0-alpha.1

* feature/issue 923 native import attributes for CSS and JSON (#1215)

* intial draft of import attributes support for CSS and JSON

* all test cases passing

* need patch package

* wcc patches for import attributes and CSSStylesheet shim

* bump min NodeJS version for exp specs

* temp disable ESLint

* develop based import assertion specs

* serve based import attributes specs

* add preIntercept resource plugin lifecycle and refactor PostCSS to use it

* all test cases passing for import attributes support

* refactor built in CSS and JSON intercepting

* demo code

* raw plugin docs and package.json updates

* update latest documentation for custom loaders support in NodeJS

* update custom import docs

* upgrade wcc v0.13.0

* only need Node 18 for github actions

* css imports and raw plugin interop with test cases

* lit renderer import attribute test cases and documentation

* refactor matchers support for raw plugin instead of patching and add test cases

* disable describe.only

* update usage for custom resource plugins to showcase usage of import attributes

* document preIntercept lifecycle and convert Babel to use it

* restore ESLint

* enable debug logging for failing specs

* refactor theme pack specs

* fix linting

* remove CSS and JSON packages from being publishable

* clean up console logs and comments

* rename exp test cases to loadersnaming prefix

* fix command in github actions

* remove plugin-import-css callout from plugin-postcss README

* remove demo code from website

* refine PostCSS plugin intercepting

* first pass on resource tracking and bundling refactor with lit polyfills removal from CLI

* interim work around to solve double rendering and undefined WCC bugs

* refactor frontmatter for graph and standard html plugin for SSR

* rename templates directory to layouts

* refactor over bundling of static script assets in bundleSsrPages

* handle bundling styles within bundleSsrPages

* post rebase tweaks

* custom elements as layouts

* post rebase tweaks

* WCC patched support for TS pages

* support and tests for API routes as a custom dynamic format

* restore TS tests and make servePage default

* document custom page format support

* fix lint

* patch latest WCC TypeScript changes

* cleanup default app layout content

* handle rollup circular dependency warnings for API routes

* rename test cases from templates to layout

* collapse API routes directory into pages directory

* bump to wc-compiler 0.14.0

---------

Co-authored-by: Paul Barry <devlab2425@gmail.com>
thescientist13 added a commit that referenced this pull request Jun 22, 2024
* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin
thescientist13 added a commit that referenced this pull request Jun 22, 2024
… integrations (#1234)

* feature/discussion 1117 Isolation Mode (v1) (#1206)

* isolation mode for SSR pages and API routes for greenwood serve

* documentation for isolation mode option and global config test case

* misc refactoring

* set isolation mode to true for Lit renderer plugin

* set isolation mode to true for Lit renderer plugin

* v0.30.0-alpha.0

* v0.30.0-alpha.1

* feature/issue 923 native import attributes for CSS and JSON (#1215)

* intial draft of import attributes support for CSS and JSON

* all test cases passing

* need patch package

* wcc patches for import attributes and CSSStylesheet shim

* bump min NodeJS version for exp specs

* temp disable ESLint

* develop based import assertion specs

* serve based import attributes specs

* add preIntercept resource plugin lifecycle and refactor PostCSS to use it

* all test cases passing for import attributes support

* refactor built in CSS and JSON intercepting

* demo code

* raw plugin docs and package.json updates

* update latest documentation for custom loaders support in NodeJS

* update custom import docs

* upgrade wcc v0.13.0

* only need Node 18 for github actions

* css imports and raw plugin interop with test cases

* lit renderer import attribute test cases and documentation

* refactor matchers support for raw plugin instead of patching and add test cases

* disable describe.only

* update usage for custom resource plugins to showcase usage of import attributes

* document preIntercept lifecycle and convert Babel to use it

* restore ESLint

* enable debug logging for failing specs

* refactor theme pack specs

* fix linting

* remove CSS and JSON packages from being publishable

* clean up console logs and comments

* rename exp test cases to loadersnaming prefix

* fix command in github actions

* remove plugin-import-css callout from plugin-postcss README

* remove demo code from website

* refine PostCSS plugin intercepting

* general enhancements and fixes for custom resource plugin integrations

* misc clean up validation testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.0 breaking CLI documentation Greenwood specific docs feature New feature or request Plugins Greenwood Plugins SSR v0.30.0
Projects
Development

Successfully merging this pull request may close these issues.

1 participant