-
Notifications
You must be signed in to change notification settings - Fork 982
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
feat(og-gen): Implement middleware and hooks #10469
Conversation
…g-gen-mw-p2 * 'main' of github.com:redwoodjs/redwood: feat(og-gen): Adds package and vite plugin for dynamic og generation (#10439) chore(deps): bump browserify-sign from 4.2.1 to 4.2.3 (#10446) chore(deps): bump tar from 6.1.11 to 6.2.1 in /docs (#10438) chore(deps): update dependency firebase to v10.11.0 (#10366) fix(auth): Handle when authorization header is lowercased (#10442) Update rbac.md - code match (#10405) chore: make crwa e2e test work across branches (#10437) feat: [Auth] Common AuthProvider & use* changes for middleware auth (#10420)
…g-gen-mw-p2 * 'main' of github.com:redwoodjs/redwood: feat(og-gen): Update implementation of useLocation | Update App template (#10441)
…g-gen-mw-p2 * 'main' of github.com:redwoodjs/redwood: chore(dbauth-mw): Refactor web side dbAuth creation (#10460) chore(router): Prevent circular dependency for namedRoutes (#10463) chore(router): route-validators: Better types and clean up comments (#10462) feat(server-auth): dbAuth 3/3 - handle login, logout, signup, etc. requests if forwarded from middleware (#10457) docs(router): Document new NavLink className replacement behavior (#10401) chore(refactor): Split the router out into smaller logical units (#10434) feat(server-auth): Part 1/3: dbAuth middleware support (web side changes) (#10444) chore(auth): Build: Put ESM at the root, and CJS in /cjs (#10458) fix(ssr): Successfully serve static assets like `favicon.png` (#10455) chore(deps): update chore (#10367) (docs) Fix useCache headers and links (#10451) chore: remove aws-lambda (#10450) chore(deps): update dependency typescript to v5.4.5 (#10452)
…d into feat/dc-rc-og-gen-mw-p2 * 'feat/dc-rc-og-gen-mw-p2' of github.com:redwoodjs/redwood: set type=module and build for both esm and cjs
This reverts commit 7d3adb8.
I’ll have a look |
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
…g-gen-mw-p2 * 'main' of github.com:redwoodjs/redwood: RSC: Add RSC+SSR smoke test to CI (#10477) fix(dbauth-mw): Use response passed in to middleware (#10516) Add redwood.toml to `yarn rw info` (#10518) chore(tests): Fix packages/web tests (#10517) fix(dbauth-mw): Unset cookie instead of clearing (#10502) chore(deps): Upgrade to React canary 20240424 (#10513) chore(deps): Upgrade to React Testing Library 14.3.1 (#10514) feat(upgrade): Use GitHub token if available when downloading patches (#10515)
I built an app from scratch using this branch and everything worked great! I manually made the changes to |
No official docs for the real site yet, but we'll have an announcement blog post that walks through the whole thing. I think when we get closer to SSR being promoted from experimental to feature flag I can write an official reference doc for it. |
…e-middleware-client * 'main' of github.com:redwoodjs/redwood: chore(server-auth): Automagic middleware auth on supported providers (dbAuth so far) (redwoodjs#10529) feat(baremetal): Add more details to error messages (redwoodjs#10527) feat(baremetal): Add verbose output to ssh exec (redwoodjs#10525) Fix typos in seo-head (`<Metadata />`) docs (redwoodjs#10526) chore(cli): Wrap NodeSSH to make sshExec an instance method (redwoodjs#10524) Fix broken Azure / MSAL documentation links (redwoodjs#10505) chore(deps): Stop using PR build of rehackt - use proper version (redwoodjs#10523) feat(og-gen): Implement middleware and hooks (redwoodjs#10469) RSC: Rename RSC CI test case (redwoodjs#10521) feat(eslint): Disable restricted $api imports for entryserver (redwoodjs#10520) RSC: Add RSC+SSR smoke test to CI (redwoodjs#10477) fix(dbauth-mw): Use response passed in to middleware (redwoodjs#10516)
The OG Gen saga continues with @cannikin and @dac09 ⚔️
This PR adds OgImageMiddleware and Hooks to
@redwoodjs/og-gen
.This PR:
@redwoodjs/og-gen
, complete with testsThis is so that we can pass the OG component to be rendered with your App's CSS setup.
I've also coordinated with Tobbe on these changes so we don't need to change things again for server router.
How to use this?
Registering the middleware:
Configure your
vite.config.ts
Add your OG Image component next to the page it's for
e.g. web/src/pages/AboutPage/AboutPage.png.tsx
Use hooks on AboutPage to generate the ogURL
Tasks:
- [ ] Can we support image src imports? Not strictly necessary.Known limitation. You have to put images in the public folder. We can improve later
- [ ] DOCSWe decided to make it a blog post instead, since this is under experimental still