-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Router: <Set wrap={}> #1898
Router: <Set wrap={}> #1898
Conversation
9522b0b
to
d1873ab
Compare
Given there was some last minute discussion over naming in Prerender, is there consensus among using the terms "Set" and "wrap"? It feels like one is adding some UI information to the routing by wrapping the routing it the way the page is rendendered. But, now that I type that I realize that declaring and Page and the prerender option is doing just exactly that. Some other options: wrap -> render others? |
fe9ba3a
to
82c5db5
Compare
We iterated on a few different names, and this was @mojombo's latest suggestion. I liked it, and no one complained or came with any other suggestions after that, so that's what I went with. |
74d197b
to
baa6d7c
Compare
packages/core/src/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts
Outdated
Show resolved
Hide resolved
9c4699e
to
ed3dc2d
Compare
2ab08b0
to
15381e4
Compare
Can anyone remind me where the final RFC design + scope for this ended up? Was trying to find an issue for reference. @Tobbe Might be nice to include the original conversation in your OP. Thanks for cranking on this, Tobbe! |
@@ -7,19 +7,19 @@ const createHistory = () => { | |||
listen: (listener: Listener) => { | |||
const listenerId = 'RW_HISTORY_LISTENER_ID_' + Date.now() | |||
listeners[listenerId] = listener | |||
window?.addEventListener('popstate', listener) | |||
global.addEventListener('popstate', listener) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok for these to not use the optional chaining operator ?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is global
undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant for the execution of the functions; global.addEventListener?.()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, should be fine. We're not triggering any navigations when prerendering, are we? So, even using window
would have been fine. But to be consistent I'll use global
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So close now!
e9d633d
to
b4c7469
Compare
…r-rwt-link * 'main' of github.com:redwoodjs/redwood: (26 commits) Router: Fix auth (redwoodjs#2038) Steps towards a11y for Redwood Router (redwoodjs#1817) Router: <Set wrap={}> (redwoodjs#1898) Pass event and context into getCurrentUser (redwoodjs#1908) Implement Redwood API side Logger (redwoodjs#1937) Fixed path on windows to allow for pages under subdirectories (redwoodjs#2022) Add experimental ESBuild for api side (redwoodjs#1948) Upgrade to Prisma 2.19.0 (Prisma Migrate GA) (redwoodjs#2021) Fix lint breaking when deleting a side (redwoodjs#2017) Refactor: Converted Prisma.ts to js (redwoodjs#1958) Fix issue with verify email redirect using Auth0 (redwoodjs#1990) add GitHub Action CodeQL Analysis (redwoodjs#1951) fix: correct var name for grabbing user config (redwoodjs#2002) Create functions to fs calls (redwoodjs#2007) Return signup Output (redwoodjs#1992) Add makeExecSchema options (redwoodjs#1964) upgrade gotrue-js to 0.9.29 (redwoodjs#2011) Azure Active Directory Auth: Adding try-catch block on callback to capture empty key (redwoodjs#2010) withCellHOC: Fix TS error (redwoodjs#1967) Update error message in tasks/publish-local to point to tasks/run-local-npm when Verdaccio isn't running (redwoodjs#2004) ...
This PR adds support for
<Set wrap={}>
, that allows users to create sets of routes and wrap them with layouts and other components.This is the implementation that came out of the discussion over on our forums: https://community.redwoodjs.com/t/redwood-router-with-layouts-context-providers-etc/1342