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

chore(route-manifest): Add relativeFilePath to route manifest #10416

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

dac09
Copy link
Collaborator

@dac09 dac09 commented Apr 4, 2024

Rationale
For OG Middleware, we need to know the original src path of the route. This is so we can find the relevant component to render as an image.

We want to keep the same name as the routes returned from getProjectRoutes, so we don't litter if statements.

How will this work eventually?

  1. Add original file path (Relative path from project routes) to route manifest.
  2. In vite plugin, map filepath to ogImg/AboutPage/AboutPage.mjs: this is the og image component in the dist folder. The ogImg components will maintain the same nesting/directory structure as the pages
  3. In the middleware, we find the matching route
  4. Now that we know the original file path, so we can lookup the og image component (and if it doesn't exist, 404)

Extra
This PR also removes renderMode as it's not used

@dac09 dac09 added the release:chore This PR is a chore (means nothing for users) label Apr 4, 2024
@dac09 dac09 added this to the SSR milestone Apr 4, 2024
@Tobbe Tobbe added the changesets-ok Override the changesets check label Apr 4, 2024
@dac09 dac09 merged commit 23c74ca into redwoodjs:main Apr 4, 2024
53 of 59 checks passed
@dac09 dac09 deleted the feat/relative-path-route-manifest branch April 4, 2024 16:12
dac09 added a commit to dac09/redwood that referenced this pull request Apr 9, 2024
…auth-provider-p1

* 'main' of github.com:redwoodjs/redwood:
  fix(middleware): Handle POST requests in middleware router too (redwoodjs#10418)
  chore(ci): get ci running on next (redwoodjs#10432)
  RSC: Explain noExternal vite config option (redwoodjs#10429)
  chore(web): Fix .d.ts overwrite build issue (redwoodjs#10431)
  chore(web): .js imports to prep for ESM (redwoodjs#10430)
  chore(refactor): Split rwjs/forms up into several smaller logical units (redwoodjs#10428)
  chore(rsc): simplify `noExternals` config (redwoodjs#10220)
  chore(deps): Update vite to 5.2.8 (redwoodjs#10427)
  chore(auth): Convert `@redwoodjs/auth` to ESM+CJS dual build (redwoodjs#10417)
  chore(framework-tools): Warn about missing metafile (redwoodjs#10426)
  chore(test): Switch rwjs/auth over to vitest (redwoodjs#10423)
  chore(whatwg-fetch): Switch to importing instead of requiring (redwoodjs#10424)
  chore(deps): bump undici from 5.28.3 to 5.28.4 in /.github/actions/check_changesets (redwoodjs#10421)
  chore(route-manifest): Add relativeFilePath to route manifest (redwoodjs#10416)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:chore This PR is a chore (means nothing for users)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants