Recoilize icon indicating copy to clipboard operation
Recoilize copied to clipboard

Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0

Open kevintap-idemia opened this issue 3 years ago • 12 comments

https://github.com/open-source-labs/Recoilize/blob/96db24bda5208b464907b2880e87b7b44299d65a/package/index.js#L59

Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0. This API changed to Snapshot.getInfo_UNSTABLE().deps. Recoilize needs to be updated here to be compatible with the latest recoil 0.2.0 release.

kevintap-idemia avatar Apr 18 '21 12:04 kevintap-idemia

Any workarounds for this issue ? :)

TheMadKow avatar May 04 '21 08:05 TheMadKow

Same problem, any help please? 👍

samihamine avatar May 04 '21 14:05 samihamine

@TheMadKow while waiting for the update, you can modify the index.js file by replacing :

nodes.forEach(node => { // const getDeps = [...snapshot.getDeps_UNSTABLE(node)]; const getDeps = [...snapshot.getInfo_UNSTABLE(node).deps]; nodeDeps[node.key] = getDeps.map(dep => dep.key); });

Thanks, @kevintap-idemia for the help ;)

samihamine avatar May 04 '21 14:05 samihamine

@SammyHam Thanks for the solution! Could you create a pull request for that please ?

johannbuscail avatar May 05 '21 17:05 johannbuscail

Done #140

samihamine avatar May 07 '21 15:05 samihamine

It would be great to get this PR merged - we're having to manually update the index.js everytime we add recoilize, and it's getting a bit tiresome.

The work is already done, just needs merging. @razananisathar @nbargers is there anything further we can help with to push this along?

stheobald avatar Jun 10 '21 01:06 stheobald

I suspect that this is not being merged due to backwards compat concerns. The PR would allow compatibility with recoil 0.2.0+, but would then break compatibility with older recoil releases (0.1.3), which is the current stated compatible/tested recoil release in the docs for the recoilize 2.0.1 release. Perhaps @SammyHam if you re-work your PR to allow backwards compat, this might be simpler to merge?

kevintap-idemia avatar Jun 10 '21 13:06 kevintap-idemia

Thank you for the workaround!

JacopoLuri avatar Aug 11 '21 10:08 JacopoLuri

Is this issue fixed? because I also tried to add this change in the index.js file and the chrome extension just crashed!

showmen-gupta avatar Dec 23 '21 12:12 showmen-gupta

Is this issue fixed? because I also tried to add this change in the index.js file and the chrome extension just crashed!

I believe the PR which fixed this issue was merged (https://github.com/open-source-labs/Recoilize/pull/140), and it would be included inside the release of v3.0.0 if it comes in the near future as planned.

ibarapascal avatar Jan 31 '22 00:01 ibarapascal

I'm getting another error after I updated the getDeps function:

Uncaught TypeError: Cannot read properties of undefined (reading '_internalRoot')

with the function:

const createDevToolDataObject = (filteredSnapshot, diff) => {
    if (diff === undefined) {
      return {
        filteredSnapshot: filteredSnapshot,
        componentAtomTree: formatFiberNodes(
          recoilizeRoot._reactRootContainer._internalRoot.current,
        ),
      };
    } else {
      return {
        filteredSnapshot: filteredSnapshot,
        componentAtomTree: formatFiberNodes(
          recoilizeRoot._reactRootContainer._internalRoot.current,
        ),
        indexDiff: diff,
      };
    }
  };

Is this because I'm using React 18?

adamdaly avatar Apr 07 '22 15:04 adamdaly

This is still an issue

krupeshanadkat-byjus avatar Apr 19 '22 12:04 krupeshanadkat-byjus