-
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
createCell: Give cell results priority over cell props #4304
Conversation
The alternative, that was discussed, was to throw an error if the query result name clashes with a prop name. I think this solution is more inline with what we do if a query param clashes with a path param (path param always takes precedence). I also think it fits with RW's opinionated nature of just deciding on how things should work, that's the right fit 99 times out of 100, and provide ways to work around it for the 1%. |
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.
Looks good! commonProps
becomes a little less useful/precise of an abstraction but I can't think of a better name right now
Yeah, I know. I considered getting rid of it and just spread everything where it's used. You want me to do that instead? |
Yeah that'd be better at this point I think |
Done! |
9e7bc81
to
1ee77f6
Compare
Technically this is a breaking change. How vocal do we need to be about that? |
Discussed this on a Core Team meeting today. We're good to go with this solution. |
1ee77f6
to
84865b5
Compare
…ize-jest-config * 'main' of github.com:redwoodjs/redwood: Update dependency @types/vscode to v1.63.2 (redwoodjs#4332) createCell: Give cell results priority over cell props (redwoodjs#4304) Update dependency node-notifier to v10.0.1 (redwoodjs#4331) Update dependency core-js to v3.21.0 (redwoodjs#4330) Update dependency @clerk/clerk-js to v2.12.1 (redwoodjs#4327) Update dependency @clerk/types to v1.24.1 (redwoodjs#4328) Update dependency supertokens-node to v8.6.0 (redwoodjs#4324) Update prisma monorepo to v3.9.0 (redwoodjs#4329) Update dependency @types/node to v16.11.22 (redwoodjs#4326)
@Tobbe were any doc updates needed with this one? (just a nudge... no need to reply) |
@thedavidprice I'm already talking to Dom about docs. We'll figure it out 🙂 |
This PR resolves #2962
It's not the solution we decided on, but it's the solution I want 😁
So, this is the setup
and a cell query like this
And finally a Success component like this
With my new implementation you'd see this:
With the old implementation all you'd get was this:
And, finally, if you want to get at the actual props that have been over-ridden by the query result you can find them in
variables
: