Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0 #136

Open
kevintap-idemia opened this issue Apr 18, 2021 · 12 comments
Open

Snapshot.getDeps_UNSTABLE has been removed in recoil 0.2.0 #136

kevintap-idemia opened this issue Apr 18, 2021 · 12 comments

Comments

@kevintap-idemia
Copy link

const getDeps = [...snapshot.getDeps_UNSTABLE(node)];

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.

@TheMadKow
Copy link

Any workarounds for this issue ? :)

@samihamine
Copy link
Contributor

Same problem, any help please? 👍

@samihamine
Copy link
Contributor

samihamine commented May 4, 2021

@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 ;)

@johannbuscail
Copy link

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

@samihamine
Copy link
Contributor

Done #140

@stheobald
Copy link

stheobald commented Jun 10, 2021

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?

@kevintap-idemia
Copy link
Author

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?

@JacopoLuri
Copy link

Thank you for the workaround!

theZiggurat added a commit to theZiggurat/Recoilize that referenced this issue Nov 20, 2021
theZiggurat added a commit to theZiggurat/Recoilize that referenced this issue Nov 20, 2021
@showmen-gupta
Copy link

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

@ibarapascal
Copy link

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 (#140), and it would be included inside the release of v3.0.0 if it comes in the near future as planned.

@adamdaly
Copy link

adamdaly commented Apr 7, 2022

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?

@krupeshanadkat-byjus
Copy link

This is still an issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants