fix(types): use supabase-js CreateClientHelper #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re-using the types from
supabase-js
the way we do can cause issue whensupabase-js
upgrade as peer-dependency. Since mismatch can occurs between howsupabase-js
declare his types and how they're used in this repo.Since it's a duplication of the
createClient
with additionals and stricter options, this is a draft to attempt to reduce this duplication and have this more driven bysupabase-js
repo. So when updates are needed, everything inssr
type-wise adapt transparently.This will require first: supabase/supabase-js#1491 to pass on.
Once it's done, the idea is to re-use the
CreateClientHelper
andGenericSupabaseClient
instead of hard-coded definition we'll re-use. Then it's up tosupabase-js
to provide consistent exports for those types to make them compatible with the underlyingpostgrest-js
types if changes occurs.While this provide the benefits of reducing code duplication across our repos, this also have two drawbacks:
supabase-js
(now has to take into account additional options)It also introduce some basics smoke tests over the types expected from both
createServerClient
andcreateBrowserClient
BREAKING CHANGES: will not work with previous version of supabase-js where the helper wasn't defined