Skip to content

Conversation

phamhieu
Copy link
Member

@phamhieu phamhieu commented Mar 18, 2021

What kind of change does this PR introduce?

Implement storage api with a next-storage example app.

What is the current behavior?

To run example app:

  • clone supabase-js and checkout feat/storage-api branch
  • build the library with npm run build
  • cd example/next-storage/
  • create .env.local file under next-storage app
  • run example app with npm run dev
// .env.local for testing
NEXT_PUBLIC_SUPABASE_URL=https://iptgkdvhveztktwedveb.supabase.net
NEXT_PUBLIC_SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxNjAyNjU5MywiZXhwIjoxOTMxNjAyNTkzfQ.pJ4KSEklFuT9Isou259JoUtfQ9xl1zO1zxyk_2Q51Dw

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Screenshot 2021-03-18 at 1 48 41 PM

@phamhieu
Copy link
Member Author

phamhieu commented Mar 18, 2021

after uploading avatar if you refresh the browser it will show no avatar available. You have to sign-out and sign-in again to sync user data.

related to this bug on gotrue-js supabase/auth-js#67

setSession(session)
})

realtimeProfiles = supabase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phamhieu you had a problem with realtime only returning one item right? What code changes did you make to fix it? I want to make sure we're suggesting the best method for next.js/react

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phamhieu/realtime-map@f2d5001

I update the code to use useReducer. Then on realtime callback i use dispatch to trigger change on my UI. It works nicely

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🔥

file: File
): Promise<{ data: { message: string } | null; error: Error | null }> {
try {
if (!isBrowser()) throw new Error('No browser detected.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to check what other libs are doing here for the Node environment

@kiwicopple kiwicopple merged commit 98d85cf into master Mar 23, 2021
@kiwicopple kiwicopple deleted the feat/storage-api branch March 23, 2021 11:25
@kiwicopple
Copy link
Member

🎉 This PR is included in version 1.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants