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

Feature/add support for third party templating #64

Merged
merged 6 commits into from
Sep 29, 2023

Conversation

kmelve
Copy link
Member

@kmelve kmelve commented Sep 29, 2023

I started digging into #59 and noticed that we could simplify the developer experience of this plugin and bring it closer to the Astro conventions:

Removes the useSanityClient() hook. It caused problems when imported into client-side non-Astro files
Introduces the import { sanityClient } from 'sanity:client' pattern, which works across .astro and non-.astro files
Adds a JSX component with client-side data-fetching to the example
This is a breaking change since it deprecates the useSanityClient hook.

Some commits in this PR intentionally don't follow Vite plugin conventions in favor of adopting Astro integration conventions.

I think I managed to include typing support for the modules, but that is a thing to double-check.

@kmelve kmelve requested a review from a team as a code owner September 29, 2023 17:04
@vercel
Copy link

vercel bot commented Sep 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
sanity-astro-example ✅ Ready (Inspect) Visit Preview Sep 29, 2023 5:04pm
sanity-astro-example-ssr ✅ Ready (Inspect) Visit Preview Sep 29, 2023 5:04pm

@kmelve kmelve merged commit 692e80e into main Sep 29, 2023
10 checks passed
@kmelve kmelve deleted the feature/add-support-for-third-party-templating branch September 29, 2023 17:13
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant