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/issue 878 ssr custom resources #992

Merged
merged 23 commits into from
Nov 21, 2022

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Nov 1, 2022

Related Issue

Resolves #878 (alternative to #930)

Summary of Changes

  1. Initial implantation with support for using import with CSS and JSON in NodeJS
  2. Setup GitHub Actions testing to accommodate for tests for experimental features
  3. Upgrade gallinago to support passing args to the child process that handles running Greenwood in tests

TODO

  1. Depends on upgrade to WCC 0.6.x #993
  2. Figure out JSON support
  3. Add basic test cases
    • CSS
    • JSON
    • enable in GitHub Actions
  4. Depends on forward parent args to child process thescientist13/gallinago#27
  5. Get experimental specs passing on Windows (find equivalent of $(pwd) in Windows)~~
  6. Validate other import plugins - found some issues, so created support resource plugin based transformations for non "standard" module formats (ex: TypeScript, GraphQL) for SSR #1004
    • GraphQL (.gql)
    • TypeScript (.ts)
  7. Test all greenwood.config.js plugins for SSR support (may be WCC related)
  8. Explore role / overlap of import assertions - will defer to import attributes for standard module formats; CSS and JSON  #923
  9. figure out if ?type=json is still useful / needed - breaks in SSR, so should try and cutover to import assertions - import attributes for standard module formats; CSS and JSON  #923
  10. research shortCircuit to validate correct settings / usage
  11. reconcile minimum node version of 16.x (and 18.x?) for project + GitHub Actions - standalone PR
  12. restore package.json build and develop commands
  13. Add documentation
    • Minimum Node version
    • Experimental

@thescientist13 thescientist13 added documentation Greenwood specific docs Plugins Greenwood Plugins CLI SSR feature New feature or request labels Nov 1, 2022
@thescientist13 thescientist13 force-pushed the feature/issue-878-ssr-custom-resources branch from a640af1 to 8764136 Compare November 3, 2022 01:05
@thescientist13 thescientist13 force-pushed the feature/issue-878-ssr-custom-resources branch from d75dfab to 04cca5a Compare November 11, 2022 16:18
.nvmrc Outdated
@@ -1 +1 @@
14.17.0
16.15.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should actually be 16.17.0 to align with loaders API

* add cloud IDE caveat to puppeteer renderer plugin readme (#967)

* init commit of refactoring for script tags with a src

* initial CSS optimizing

* sync optimized link tags in final output

* refactored for shared reources

* handle inline script bundling

* support serving custom resources using Greenwood plugins in Rollup configuration without needing extra rollup plugin

* non resource related Rollup plugins supported

* custom resource plugins and rollup plugins working together

* handle empty input for Rollup

* updated lock file

* handle inline style tag bundling and optimizing

* default optimization spec passing

* refactor merging app and page templates

* clarifying corrections in spec files

* inline optimization config working

* none optimization support

* none optimization support

* none and static optimization overrides

* refactor html rendering and optimizing

* refactoring and more CLI specs passing

* add missing variable

* SSR specs and optimizing resource bundling

* minor refactoring and logging

* resolving some plugin specs

* restore develop command related GraphQL specs

* custom graphql query spec

* all specs passing

* drop rollup plugin deps from import typescript plugin

* all Greenwood commands and specs passing

* restore static router with custom prerender

* restore postcss-import

* refactor shared resources to a Map and handle dupes

* restore local packages workaround for local Rollup bundling

* better monorepo Rollup facade modules detection

* switch console log

* remove console logging

* update plugin related docs

* local solution for windows support

* refactor errant object assign

* full cross platform URL support

* fix lint

* fix extra bundles when custom prerendering

* clean up stale or already tracked TODOs

* add nested head tag smoke tests

* check for app template validation for HUD display

* misc refactoring and TODOs cleanup

* restore static router (again)

* standardize passing correct reference for prerender scripts

* clean up data-gwd-opt markers from final HTML
@thescientist13 thescientist13 force-pushed the feature/issue-878-ssr-custom-resources branch from d6bdb32 to 4a448cf Compare November 19, 2022 19:31
@thescientist13 thescientist13 marked this pull request as ready for review November 20, 2022 21:45
@@ -203,6 +203,26 @@ async function getTemplate(compilation, route) {
}
```

### Custom Imports (Experimental)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should move the Experimental to its own line so deep links don't break when / if the experimental label gets removed.

@thescientist13 thescientist13 merged commit 04e25c4 into release/0.27.0 Nov 21, 2022
@thescientist13 thescientist13 deleted the feature/issue-878-ssr-custom-resources branch November 21, 2022 18:35
thescientist13 added a commit that referenced this pull request Nov 23, 2022
* Enhancement/issue 971 refactor bundling and optimizations (#974)

* add cloud IDE caveat to puppeteer renderer plugin readme (#967)

* init commit of refactoring for script tags with a src

* initial CSS optimizing

* sync optimized link tags in final output

* refactored for shared reources

* handle inline script bundling

* support serving custom resources using Greenwood plugins in Rollup configuration without needing extra rollup plugin

* non resource related Rollup plugins supported

* custom resource plugins and rollup plugins working together

* handle empty input for Rollup

* updated lock file

* handle inline style tag bundling and optimizing

* default optimization spec passing

* refactor merging app and page templates

* clarifying corrections in spec files

* inline optimization config working

* none optimization support

* none optimization support

* none and static optimization overrides

* refactor html rendering and optimizing

* refactoring and more CLI specs passing

* add missing variable

* SSR specs and optimizing resource bundling

* minor refactoring and logging

* resolving some plugin specs

* restore develop command related GraphQL specs

* custom graphql query spec

* all specs passing

* drop rollup plugin deps from import typescript plugin

* all Greenwood commands and specs passing

* restore static router with custom prerender

* restore postcss-import

* refactor shared resources to a Map and handle dupes

* restore local packages workaround for local Rollup bundling

* better monorepo Rollup facade modules detection

* switch console log

* remove console logging

* update plugin related docs

* local solution for windows support

* refactor errant object assign

* full cross platform URL support

* fix lint

* fix extra bundles when custom prerendering

* clean up stale or already tracked TODOs

* add nested head tag smoke tests

* check for app template validation for HUD display

* misc refactoring and TODOs cleanup

* restore static router (again)

* standardize passing correct reference for prerender scripts

* clean up data-gwd-opt markers from final HTML

* v0.27.0-alpha.0

* experimental loaders for SSR custom resources

* set minimum nodejs v16.x requirement

* latest WIP

* custom SSR loaders for JSON

* working test case testing for SSR prerender with import CSS plugin

* experimental test task and github actions

* remove demo code

* add test cases for import JSON with prerendering

* upgrade latest gallinago

* enable experimental testing capabilities for CI

* post rebase reconsilations

* align versioning

* experimental specs passing on windows

* remove lint from experimental github actions

* refine exp test tasks

* minor refactor

* fix windows exp github action workflow

* increase mocha timeout for to accomodate exp test runs

* formatting

* updated import CSS and JSON plugin README docs

* SSR usage for experimental loaders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI documentation Greenwood specific docs feature New feature or request Plugins Greenwood Plugins SSR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support resource plugin based transformations for standard module formats (ex: import JSON, CSS) for SSR
1 participant