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

v0.31.0 compatability #1

Draft
wants to merge 11 commits into
base: greenwood
Choose a base branch
from
Draft

v0.31.0 compatability #1

wants to merge 11 commits into from

Conversation

thescientist13
Copy link
Owner

@thescientist13 thescientist13 commented Dec 15, 2024

Changes

  1. Added .nvmrc to ensure correct NodeJS version for fs.globSync API
  2. Fix iconify import
  3. Revert to documented usage for custom imports (for now)
  4. Comment out <script> tag to non-existent split-view.ts component
  5. Comment out all usages of export const prerender = true

Screenshot 2024-12-15 at 5 35 30 PM

TODOs / Upstreams

  1. PostCSS is breaking bundling - PostCSS plugin breaks bundling of SSR CSS-based import attributes ProjectEvergreen/greenwood#1355
    SyntaxError [Error]: Unexpected character '@' (9:0)
        at pp$4.raise (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:3640:13)
        at pp.getTokenFromCode (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5670:8)
        at pp.readToken (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5357:15)
        at pp.nextToken (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5348:15)
        at pp.next (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5309:8)
        at pp$9.eat (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:696:10)
        at pp$9.semicolon (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:743:13)
        at pp$8.parseVarStatement (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:1186:8)
        at pp$8.parseStatement (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:921:17)
        at pp$8.parseTopLevel (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:823:21) {
      pos: 161,
      loc: { line: 9, column: 0 },
      raisedAt: 161
    }
  2. luxon import map compatibility - unable to resolve packages with a nested package.json ProjectEvergreen/greenwood#1349
    WARNING: No supported entry point detected for => `luxon`
    Learn more about these warnings at => https://greenwoodjs.dev/docs/introduction/web-standards/#import-maps
  3. Seeing this error on load with a 500 in the console sometimes - intermittent Response.clone: Body has already been consumed error from the dev server ProjectEvergreen/greenwood#1350
    Screenshot 2024-12-15 at 5 38 28 PM
    TypeError: Response.clone: Body has already been consumed.
        at webidl.errors.exception (node:internal/deps/undici/undici:3564:14)
        at _Response.clone (node:internal/deps/undici/undici:9081:31)
        at file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1/node_modules/@greenwood/cli/src/lifecycles/serve.js:70:49
        at async file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1/node_modules/@greenwood/cli/src/lifecycles/serve.js:55:5
  4. frontmatter breaks bundling of SSR pages on a few cases in JSON.stringify in bundle.js - frontmatter content breaking graph data parsing in SSR pages ProjectEvergreen/greenwood#1351
    <!-- apostrophe's -->
    title: Reactions to Harry Potter and the Philosopher's Stone
    
    <!-- double quotes in frontmatter imports -->
    imports:
      - /components/section-card.ts
      - /components/grampsParser/genealogical-data.ts type="module"
    
    <!-- line breakage for title -->
    title: |
      Soteriology, Missiology and Ecclesiology
    
    <!-- nested -->
    sidebar:
      order: 1
    
    <!-- but this works -->
    sidebar:
      - order: 1
    Error [RollupError]: Expression expected
      at getRollupError (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/rollup@4.28.1/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
      at convertProgram (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/rollup@4.28.1/node_modules/rollup/dist/es/shared/parseAst.js:1084:26)
      at Object.parseAst [as parse] (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/rollup@4.28.1/node_modules/rollup/dist/es/shared/parseAst.js:2069:87)
      at Object.transform (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=or422vstudglkinl6gqejwrygu/node_modules/@greenwood/cli/src/config/rollup.config.js:284:24)
      at async transform (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/rollup@4.28.1/node_modules/rollup/dist/es/shared/node-entry.js:19663:16)
      at async ModuleLoader.addModuleSource (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/rollup@4.28.1/node_modules/rollup/dist/es/shared/node-entry.js:19879:36) {
    code: 'PLUGIN_ERROR',
    pos: 24592,
    pluginCode: 'PARSE_ERROR',
    plugin: 'greenwood-import-meta-url',
    hook: 'transform',
    id: '/Users/owenbuckley/Workspace/github-forks/HP_Stuff/.greenwood/Bookmarks/index.ts'
  5. build command is failing on unexpected CSS parsing from Rollup bundling - seems to be PostCSS plugin not co-operating w/ Import Attributes (needs repro and report on Greenwood side)? - actually it was decorators due to using Lit components
    SyntaxError [Error]: Unexpected character '@' (9:0)
    at pp$4.raise (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:3640:13)
    at pp.getTokenFromCode (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5670:8)
    at pp.readToken (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5357:15)
    at pp.nextToken (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5348:15)
    at pp.next (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:5309:8)
    at pp$9.eat (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:696:10)
    at pp$9.semicolon (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:743:13)
    at pp$8.parseVarStatement (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:1186:8)
    at pp$8.parseStatement (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:921:17)
    at pp$8.parseTopLevel (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs:823:21) {
      pos: 161,
      loc: { line: 9, column: 0 },
      raisedAt: 161
    }
  6. build && serve is borked (it seems <script> and <link> tags are not including the bundle hash) - none optimization setting leads to broken resource requests in production builds ProjectEvergreen/greenwood#1352
    • seems due to how we are handling / honoring / defining what the "none" optimization does / does not mean
      Screenshot 2024-12-16 at 9 53 31 PM
  7. Error in develop and production builds on rawAttrs for search and bookmarks pages - getting a Cannot read properties of null (reading 'rawAttrs') error ProjectEvergreen/greenwood#1353
    TypeError: Cannot read properties of null (reading 'rawAttrs')
        at getAppLayout (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/lib/layout-utils.js:221:66)
        at async StandardHtmlResource.serve (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/plugins/resource/plugin-standard-html.js:125:12)
        at async file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/lifecycles/serve.js:69:27
        at async file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/lifecycles/serve.js:55:5
  8. prerender needed due to use of active content, including not using CSSStyleSheet, but getting errors from Spectrum, which might be expected? Without this, navigation and content as data related pages will not work, so need some sort of SSR escape hatch - data client not working on production builds (when not using prerender option) ProjectEvergreen/greenwood#1354
    • actually not. needed anymore, can just do a non-prerender fallback version of data client
      Screenshot 2024-12-19 at 12 29 39 PM
    ReferenceError [Error]: HTMLElement is not defined
        at file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@spectrum-web-components+theme@1.0.3/node_modules/@spectrum-web-components/theme/src/Theme.js:1:207
        at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
        at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
        at async executeRouteModule (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+plugin-renderer-lit@0.31.0-alpha.1_@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2ll_oqnmdre54jhasioy6usskcduhm/node_modules/@greenwood/plugin-renderer-lit/src/execute-route-module.js:18:7)
        at async executeModule (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/lib/ssr-route-worker.js:6:16)
        at async MessagePort.<anonymous> (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=pkl2llrpdlpyhjjur27kchnsuq/node_modules/@greenwood/cli/src/lib/ssr-route-worker.js:12:3)
    (Use `node --trace-warnings ...` to show where the warning was created)
    ReferenceError [Error]: MutationObserver is not defined
        at file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@spectrum-web-components+base@1.0.3/node_modules/@spectrum-web-components/base/src/Base.js:1:264
        at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
        at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
        at async executeRouteModule (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+plugin-renderer-lit@0.31.0-alpha.1_@greenwood+cli@0.31.0-alpha.1_patch_hash=2qh643_3lszpd3fk2a2chxoinh2i54xni/node_modules/@greenwood/plugin-renderer-lit/src/execute-route-module.js:18:7)
        at async executeModule (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=2qh643zxmh3wwqcc2blite4fp4/node_modules/@greenwood/cli/src/lib/ssr-route-worker.js:6:16)
        at async MessagePort.<anonymous> (file:///Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@greenwood+cli@0.31.0-alpha.1_patch_hash=2qh643zxmh3wwqcc2blite4fp4/node_modules/@greenwood/cli/src/lib/ssr-route-worker.js:12:3)
  9. Looks like Resource plugin (HTML) optimizing is not working for SSR pages, as we can see content as data "setup" <script> tags not showing in the HTML - SSR pages are not have resource plugin optimization lifecycles applied ProjectEvergreen/greenwood#1363
    Screenshot 2024-12-27 at 1 41 40 PM
    Screenshot 2024-12-27 at 5 38 53 PM

Observations / Known Issues

  1. /assets/gramps/gramps.json doesn't exits
    Screenshot 2024-12-20 at 6 16 40 PM
  2. export const prerender = false; is only used for SSR pages, was causing errors in the console
    Screenshot 2024-12-20 at 6 15 55 PM
    Screenshot 2024-12-20 at 6 15 47 PM
  3. frontmatter was missing type="module"
    Screenshot 2024-12-20 at 6 19 34 PM
    Screenshot 2024-12-20 at 6 19 39 PM
    Screenshot 2024-12-20 at 6 19 45 PM
  4. improved frontmatter imports should now work - frontmatter imports not working for any format supported by a resource plugin  ProjectEvergreen/greenwood#1319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant