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

feat: add process lock for optional use in non-browser environments (React Native) #977

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

hf
Copy link
Contributor

@hf hf commented Oct 29, 2024

When using the library in non-browser environments like React Native or other JavaScript-based runtimes (Electron's main process for example) certain race conditions could still occur.

We've received some signal from customers using React Native that at scale these become more visible. This is why I'm introducing a processLock that developers can import like so:

import { processLock } from '@supabase/auth-js/lib/locks'

And add to their apps by specifying the lock option with the process lock.

@hf hf marked this pull request as ready for review October 30, 2024 11:01
Copy link
Member

@kangmingtay kangmingtay left a comment

Choose a reason for hiding this comment

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

we should update our react native guides to use this when creating the supabase client

@hf hf merged commit 8af88b6 into master Nov 1, 2024
5 checks passed
@hf hf deleted the hf/add-process-lock branch November 1, 2024 17:47
kangmingtay pushed a commit that referenced this pull request Nov 6, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.66.0](v2.65.1...v2.66.0)
(2024-11-01)


### Features

* add process lock for optional use in non-browser environments (React
Native) ([#977](#977))
([8af88b6](8af88b6))


### Bug Fixes

* typo in warning message
([#975](#975))
([4f21f93](4f21f93))
* update soft-deletion docs
([#973](#973))
([cb052a9](cb052a9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
J0 pushed a commit that referenced this pull request Nov 12, 2024
…React Native) (#977)

When using the library in non-browser environments like React Native or
other JavaScript-based runtimes (Electron's main process for example)
certain race conditions could still occur.

We've received some signal from customers using React Native that at
scale these become more visible. This is why I'm introducing a
`processLock` that developers can import like so:

```typescript
import { processLock } from '@supabase/auth-js/lib/locks'
```

And add to their apps by specifying the lock option with the process
lock.
J0 pushed a commit that referenced this pull request Nov 12, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.66.0](v2.65.1...v2.66.0)
(2024-11-01)


### Features

* add process lock for optional use in non-browser environments (React
Native) ([#977](#977))
([8af88b6](8af88b6))


### Bug Fixes

* typo in warning message
([#975](#975))
([4f21f93](4f21f93))
* update soft-deletion docs
([#973](#973))
([cb052a9](cb052a9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants