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

Broken fiber-triangle-demo and schedule fixtures #12930

Closed
flarnie opened this issue May 29, 2018 · 1 comment · Fixed by #12931
Closed

Broken fiber-triangle-demo and schedule fixtures #12930

flarnie opened this issue May 29, 2018 · 1 comment · Fixed by #12931
Assignees

Comments

@flarnie
Copy link
Contributor

flarnie commented May 29, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
These two fixtures are both broken due to a reference to global in the bundle they reference.

This was introduced in a PR I just landed, so I'm fixing it. See #12900

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

Open either fixture in Firefox, note the error in the console and the page doesn't update.

What is the expected behavior?
They should have React and/or the schedule module running JS on the page.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Just on master.

@flarnie flarnie self-assigned this May 29, 2018
flarnie added a commit to flarnie/react that referenced this issue May 29, 2018
**what is the change?:**
In a recent PR we were referencing some global variables and storing
local references to them.

To make things more natural, we co-opted the original name of the global
for our local reference. To make this work with Flow, we get the
original reference from 'window.requestAnimationFrame' and assign it to
'const requestAnimationFrame'.

Sometimes React is used in an environment where 'window' is not defined
- in that case we need to use something else, or hide the 'window'
reference somewhere.

We opted to use 'global' thinking that Babel transforms would fill that
in with the proper thing.

But for some of our fixtures we are not doing that transform on the
bundle.

**why make this change?:**
I want to unbreak this on master and then investigate more about what we
should do to fix this.

**test plan:**
run `yarn build` and open the fixtures.

**issue:**
facebook#12930
@aweary
Copy link
Contributor

aweary commented May 29, 2018

The DOM fixtures are also broken, I was just trying to figure out if I broke something 😄

flarnie added a commit that referenced this issue May 30, 2018
**what is the change?:**
In a recent PR we were referencing some global variables and storing
local references to them.

To make things more natural, we co-opted the original name of the global
for our local reference. To make this work with Flow, we get the
original reference from 'window.requestAnimationFrame' and assign it to
'const requestAnimationFrame'.

Sometimes React is used in an environment where 'window' is not defined
- in that case we need to use something else, or hide the 'window'
reference somewhere.

We opted to use 'global' thinking that Babel transforms would fill that
in with the proper thing.

But for some of our fixtures we are not doing that transform on the
bundle.

**why make this change?:**
I want to unbreak this on master and then investigate more about what we
should do to fix this.

**test plan:**
run `yarn build` and open the fixtures.

**issue:**
#12930
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 a pull request may close this issue.

2 participants