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

Open
subtleGradient opened this issue Feb 6, 2019 · 9 comments

Comments

Projects
None yet
8 participants
@subtleGradient
Copy link
Contributor

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link

commented Feb 10, 2019

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

@bitttttten

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

commented Mar 7, 2019

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

@psychobolt

This comment has been minimized.

Copy link

commented Mar 7, 2019

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

@andykais

This comment has been minimized.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.