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

More React hooks and RuntimeScalars #1280

Merged
merged 29 commits into from
Mar 7, 2024
Merged

More React hooks and RuntimeScalars #1280

merged 29 commits into from
Mar 7, 2024

Conversation

AlecAivazis
Copy link
Collaborator

@AlecAivazis AlecAivazis commented Mar 6, 2024

This PR adds 2 new hooks to the react runtime:

  • useLocation returns a Location object containing pathname
  • useSession returns the current Session object and a function that can be called on the client to update the session without forcing a hard refresh

I also wanted to play around with the scalar approach discussed in #1211 so I added it behind a feature flag under the key runtimeScalars. If anyone is interested in learning more, I also updated the query variables documentation to showcase how to use it.

To help everyone out, please make sure your PR does the following:

  • Update the first line to point to the ticket that this PR fixes
  • Add a message that clearly describes the fix
  • If applicable, add a test that would fail without this fix
  • Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • Includes a changeset if your fix affects the user with pnpm changeset

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: 3cdc871

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
houdini-react Patch
houdini Patch
houdini-adapter-auto Patch
houdini-adapter-cloudflare Patch
houdini-adapter-node Patch
houdini-svelte Patch
houdini-plugin-svelte-global-stores Patch
create-houdini Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for houdini-docs-next ready!

Name Link
🔨 Latest commit 3cdc871
🔍 Latest deploy log https://app.netlify.com/sites/houdini-docs-next/deploys/65e96e9bff2b570008e81afc
😎 Deploy Preview https://deploy-preview-1280--houdini-docs-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for houdinigraphql ready!

Name Link
🔨 Latest commit 3cdc871
🔍 Latest deploy log https://app.netlify.com/sites/houdinigraphql/deploys/65e96e9b0fbbe8000838151e
😎 Deploy Preview https://deploy-preview-1280--houdinigraphql.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AlecAivazis AlecAivazis merged commit 4e31fbb into main Mar 7, 2024
15 checks passed
@AlecAivazis AlecAivazis deleted the next branch March 7, 2024 07:45
@github-actions github-actions bot mentioned this pull request Mar 7, 2024
endigma pushed a commit to endigma/houdini that referenced this pull request Nov 10, 2024
ewen-lbh pushed a commit to ewen-lbh/houdini-graphql that referenced this pull request Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant