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

react-cache alphas don't work with 16.8+ #14780

Closed
subtleGradient opened this issue Feb 6, 2019 · 11 comments
Closed

react-cache alphas don't work with 16.8+ #14780

subtleGradient opened this issue Feb 6, 2019 · 11 comments

Comments

@subtleGradient
Copy link
Contributor

@subtleGradient subtleGradient commented Feb 6, 2019

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.

Originally posted by @jaredpalmer in jaredpalmer/the-platform#70 (comment)

@subtleGradient subtleGradient changed the title ICANHAZ react-cache release for react@1.8.1+ ? ICANHAZ react-cache release for react@16.8.1+ ? Feb 6, 2019
@SigmundurMorkore
Copy link

@SigmundurMorkore SigmundurMorkore commented Feb 7, 2019

Running into this error with react@16.8.1:

TypeError: dispatcher is undefined
This comes from the readContext() function in react-cache-development.js,

@jaredpalmer
Copy link
Contributor

@jaredpalmer jaredpalmer commented Feb 7, 2019

This can be closed.

We are building react-cache from master and using a vendor folder in the example of the-platform. Previously it was improperly included as dependency instead of a peer dependency in the-platform.

@gaearon
Copy link
Member

@gaearon gaearon commented Feb 8, 2019

Yeah I think for now our recommendation is that you can copy paste its source but then you're on your own. The caching strategy is very unclear now and the whole thing will likely change a lot. We don't want any reusable libraries to start depending on it.

We could plausibly add a big red warning on its import and then publish another alpha. If someone sends a PR seems ok to do it.

@gaearon gaearon changed the title ICANHAZ react-cache release for react@16.8.1+ ? react-cache alphas don't work with 16.8+ Feb 8, 2019
@SigmundurMorkore
Copy link

@SigmundurMorkore SigmundurMorkore commented Feb 10, 2019

I'd like to try to add a warning on import, it would however be my first contribution.

@bitttttten
Copy link

@bitttttten bitttttten commented Mar 7, 2019

How are we able to experiment with react-cache and Concurrent Mode at the moment? Since I am running into this issue with the versions below 😅

"react": "16.8.0-alpha.1",
"react-cache": "2.0.0-alpha.1",
"react-dom": "16.8.0-alpha.1",
@MuYunyun
Copy link

@MuYunyun MuYunyun commented Mar 7, 2019

@bitttttten This is Suspense demo run in react "16.8" version. You can try suspense demo in the branch use-suepense. Hope help you.

@gaearon
Copy link
Member

@gaearon gaearon commented Mar 7, 2019

If you want to experiment you should be able to build from source. :-)

@psychobolt
Copy link

@psychobolt psychobolt commented Mar 7, 2019

Seems like building it from source is the only way for now.

@andykais
Copy link

@andykais andykais commented Mar 28, 2019

The current solution is indeed building from source, but if people want to streamline the process, you can try adding this to your package.json:

  "scripts": {
    "postinstall": "git clone git@github.com:facebook/react.git --depth=1 && cd react && yarn install --frozen-lockfile && npm run build react-cache && cd .. && npm i $(npm pack ./react/build/node_modules/react-cache) && rm -rf react react-cache-*.tgz"
  },

credit goes to this stackoverflow answer

It would be awesome if react took advantage of the npm's "prepare" script and npm allowed installing from directories in git repos, but thats not likely going to change any time soon. For now, this solution is fine

luontola added a commit to luontola/territory-bro that referenced this issue May 2, 2019
BenoitZugmeyer added a commit to BenoitZugmeyer/react-suspense-demo that referenced this issue Jun 11, 2019
@stale
Copy link

@stale stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale
Copy link

@stale stale bot commented Jan 17, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants