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
Labels
Resolution: Stale Automatically closed due to inactivity Type: Question

Comments

@subtleGradient
Copy link
Contributor

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

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

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
Collaborator

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 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

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 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
Collaborator

gaearon commented Mar 7, 2019

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

@psychobolt
Copy link

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

@andykais
Copy link

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

@stale
Copy link

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 stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

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 as completed Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Type: Question
Projects
None yet
Development

No branches or pull requests

8 participants