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

Use self to get global context before window in getEventPriority. #2493

Merged
merged 3 commits into from
Sep 15, 2022

Conversation

joewhatkins
Copy link
Contributor

Prior to this change, this code would throw an error when run inside of a WebWorker, since window is not defined inside of webworkers.
This prevented us from using R3F inside of an offscreen canvas in a webworker.

See https://stackoverflow.com/questions/71587025/cant-use-offscreencanvas-with-react-three-fiber for an example.

Prior to this change, this code would throw an error when run inside of a WebWorker,
since window is not defined inside of webworkers.
This prevented us from using R3F inside of an offscreen canvas in a webworker.
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 13, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2799a05:

Sandbox Source
example Configuration

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Sep 14, 2022

We also make use of requestAnimationFrame and devicePixelRatio.

A work-around would be to specify an integer rather than a range for dpr (overriding the default) and setting frameloop="never", but I'm not sure if this is what you want here.

@joewhatkins
Copy link
Contributor Author

For our particular use case, this change alone suffices.

A work-around would be to specify an integer rather than a range for dpr (overriding the default) and setting frameloop="never", but I'm not sure if this is what you want here.

We specify an integer for DPR in our code, yeah, but our particular use case doesn't require us to set the frameloop.

@CodyJasonBennett CodyJasonBennett merged commit 8005337 into pmndrs:master Sep 15, 2022
renovate bot referenced this pull request in ziyadedher/ziyadedher Sep 15, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@react-three/fiber](https://togithub.com/pmndrs/react-three-fiber) |
[`8.7.3` ->
`8.7.4`](https://renovatebot.com/diffs/npm/@react-three%2ffiber/8.7.3/8.7.4)
|
[![age](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/compatibility-slim/8.7.3)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/confidence-slim/8.7.3)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pmndrs/react-three-fiber</summary>

###
[`v8.7.4`](https://togithub.com/pmndrs/react-three-fiber/releases/tag/v8.7.4)

[Compare
Source](https://togithub.com/pmndrs/react-three-fiber/compare/@react-three/fiber@8.7.3...v8.7.4)

#### What's Changed

- fix: use self to get global context before window by
[@&#8203;joewhatkins](https://togithub.com/joewhatkins) in
[https://github.com/pmndrs/react-three-fiber/pull/2493](https://togithub.com/pmndrs/react-three-fiber/pull/2493)

#### New Contributors

- [@&#8203;joewhatkins](https://togithub.com/joewhatkins) made their
first contribution in
[https://github.com/pmndrs/react-three-fiber/pull/2493](https://togithub.com/pmndrs/react-three-fiber/pull/2493)

**Full Changelog**:
pmndrs/react-three-fiber@v8.7.2...v8.7.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ziyadedher/ziyadedher).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTUuNSIsInVwZGF0ZWRJblZlciI6IjMyLjE5NS41In0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ziyadedher referenced this pull request in ziyadedher/ziyadedher Dec 16, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@react-three/fiber](https://togithub.com/pmndrs/react-three-fiber) |
[`8.7.3` ->
`8.7.4`](https://renovatebot.com/diffs/npm/@react-three%2ffiber/8.7.3/8.7.4)
|
[![age](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/compatibility-slim/8.7.3)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@react-three%2ffiber/8.7.4/confidence-slim/8.7.3)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pmndrs/react-three-fiber</summary>

###
[`v8.7.4`](https://togithub.com/pmndrs/react-three-fiber/releases/tag/v8.7.4)

[Compare
Source](https://togithub.com/pmndrs/react-three-fiber/compare/@react-three/fiber@8.7.3...v8.7.4)

#### What's Changed

- fix: use self to get global context before window by
[@&#8203;joewhatkins](https://togithub.com/joewhatkins) in
[https://github.com/pmndrs/react-three-fiber/pull/2493](https://togithub.com/pmndrs/react-three-fiber/pull/2493)

#### New Contributors

- [@&#8203;joewhatkins](https://togithub.com/joewhatkins) made their
first contribution in
[https://github.com/pmndrs/react-three-fiber/pull/2493](https://togithub.com/pmndrs/react-three-fiber/pull/2493)

**Full Changelog**:
pmndrs/react-three-fiber@v8.7.2...v8.7.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ziyadedher/ziyadedher).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTUuNSIsInVwZGF0ZWRJblZlciI6IjMyLjE5NS41In0=-->

Co-authored-by: renovate[bot] <29139614+renovate[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