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

update example to React v16.8.1 #70

Closed
wants to merge 1 commit into from

Conversation

subtleGradient
Copy link
Contributor

No description provided.

@jaredpalmer
Copy link
Owner

💯💯💯

@jaredpalmer
Copy link
Owner

Wait does 16.8.1 have the suspense stuff we need?

@subtleGradient
Copy link
Contributor Author

🤷‍♂️

@jaredpalmer
Copy link
Owner

lol

@jaredpalmer
Copy link
Owner

Yeah so we are pretty screwed now because react-cache was not published with 16.8.1 like the rest of the react packages. This means that the platform's Suspense stuff will not work.

@jaredpalmer
Copy link
Owner

Yeah it looks like react-cache is incompatible at the moment with 16.8.1

@gaearon
Copy link

gaearon commented Feb 6, 2019

Can you just vendor the parts of react cache that you use? It’s not ever supposed to be dependent upon.

@jaredpalmer
Copy link
Owner

Let me try that out.

@jaredpalmer
Copy link
Owner

Yeah so it looks like react-cache was improperly included as a real dep and not a peer dep. However, to run the suspense focused demo, the suspense components do indeed rely on reach-cache being compatible with the version of react. I can vendor react-cache, but will need to go through and figure out what is actually causing the issue.

When I try to run the example with 16.8.1 I get the following error from react-cache alpha 1.

Uncaught Error: react-cache: read and preload may only be called from within a component's render. They are not supported in event handlers or lifecycle methods.
    at readContext (react-cache.development.js:246)
    at Object.read (react-cache.development.js:316)
    at Video (Video.js:29)
    at renderWithHooks (react-dom.development.js:12749)
    at mountIndeterminateComponent (react-dom.development.js:14679)
    at beginWork (react-dom.development.js:15203)
    at performUnitOfWork (react-dom.development.js:18789)
    at workLoop (react-dom.development.js:18834)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)

@jaredpalmer
Copy link
Owner

Alright going to try to build react-cache from master

@gaearon
Copy link

gaearon commented Feb 6, 2019

You can find readContext implementation in a bunch of places in our tests. Note it’s not guaranteed to be stable either.

@jaredpalmer
Copy link
Owner

Hrmmmmmmm. This is an afternoon or so of work if someone wants to do it. We could also write our own cache ;-) and just not expose it. It is not very likely a user would want to flush an image cache ever.

@jaredpalmer jaredpalmer mentioned this pull request Feb 6, 2019
@jaredpalmer
Copy link
Owner

@gaearon figured it out. thanks for the help!

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.

3 participants