GithubHelp home page GithubHelp logo

Comments (10)

jasonbahl avatar jasonbahl commented on May 7, 2024 2

for now I've settled on just adding this to my app for now:

 if (process.env.NODE_ENV === 'development') {
     BrowserWindow.addDevToolsExtension( 'jdkknkkbebbapilgoeccciglkfbmbnfm' );
}

Since that seems to be working, I'll probably just keep using that.

from apollo-client-devtools.

jasonbahl avatar jasonbahl commented on May 7, 2024

Ok, so I did some digging and based on the Electron docs here (https://github.com/electron/electron/blob/master/docs/tutorial/devtools-extension.md) I was able to get Apollo Dev Tools working by adding the following:

BrowserWindow.addDevToolsExtension( '~/Library/Application Support/Google/Chrome/Default/Extensions/jdkknkkbebbapilgoeccciglkfbmbnfm/1.0.5_0' );

The other dev-tools work without having to specify this in my code, but adding this for Apollo Dev Tools got it working.

I'm not super familiar with the Dev Tools API's, but I'm curious if there's something that could be changed so that the Dev tools are instantiated, like the other dev tools, without the explicit call being added.

I have a feeling it might be related to how the panel is instantiated here: https://github.com/apollographql/apollo-client-devtools/blob/master/extension/devtools.js

It seems like the other dev tools create the panel without any conditions being checked, and check conditions inside the panel itself, such as Redux Dev Tools:
https://github.com/zalmoxisus/redux-devtools-extension/blob/master/src/browser/extension/devtools/index.js

from apollo-client-devtools.

jasonbahl avatar jasonbahl commented on May 7, 2024

Ah. . .

Digging some more, I'm seeing the React Dev Tools doing conditional creation of the panel based on similar criteria to what the Apollo Dev Tools check, however, they've added a listener to check if React is added after page load. My guess is that by time the Apollo Dev Tools are instantiated in Electron it's too early for window.__APOLLO_CLIENT__ to evaluate as true, so the Apollo dev tools just never create the panel.

I'll submit a PR for this.

from apollo-client-devtools.

stubailo avatar stubailo commented on May 7, 2024

We should be polling constantly for that value to show up, so it would be surprising if that were the issue.

from apollo-client-devtools.

jasonbahl avatar jasonbahl commented on May 7, 2024

I submitted a PR #24

Not 100% sure yet that solves the issue. I'll play with it a bit more to confirm tomorrow.

from apollo-client-devtools.

daniman avatar daniman commented on May 7, 2024

@jasonbahl Were you able to confirm if #24 fixes this issue? If so, I can merge it and release a new version of the devtools :)

from apollo-client-devtools.

jasonbahl avatar jasonbahl commented on May 7, 2024

Sorry. Haven't followed up. Will check today and let you know for sure

from apollo-client-devtools.

jasonbahl avatar jasonbahl commented on May 7, 2024

So, I'm not exactly sure how to test this locally. From what I can tell, Electron is downloading straight from the Chrome store when compiling, so I'm not quite sure how to override and have it use my local copy of Apollo Devtools instead. . .I'll dig and see if I can figure that out so I can test properly locally.

For now, my only solution has been to manually add:

 if (process.env.NODE_ENV === 'development') {
    BrowserWindow.addDevToolsExtension( '~/Library/Application Support/Google/Chrome/Default/Extensions/jdkknkkbebbapilgoeccciglkfbmbnfm/1.0.8_0' );
}

For the moment, that also means I have to manually keep the version number updated, which is obviously not ideal. . .

If I can get Electron to use my local copy of DevTools so I can fully test this, I'll let you know.

Thanks,

Jason

from apollo-client-devtools.

danielkv avatar danielkv commented on May 7, 2024

did not word for me

from apollo-client-devtools.

lucasbaze avatar lucasbaze commented on May 7, 2024

Unfortunately this did not work for me either.

It seems to only work for me if I delete everything in the extensions folder of electron and then add the path to the downloaded apollo-client-dev-tools chrome extension. It will work the first time it's loaded, but after quitting and reopening the application, it doesn't load anymore.

from apollo-client-devtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.