ndb icon indicating copy to clipboard operation
ndb copied to clipboard

Launch ndb programmatically from Electron app.

Open parliament718 opened this issue 4 years ago • 0 comments

I'm building an Electron app in which you can select a folder on the file system containing some other code, and the Electron app uses the typescript compiler API to build the application in the selected folder and then dynamically import it.

In my app.component.ts (renderer process):

    compileAndWatchApp(folderPath).subscribe(async () => {
         const module = await import(folderPath + '/index.js');
         const component = new module.SomeComponent();
         ...
    });

My requirement is to be able to debug this dynamically loaded module without freezing the UI of the electron renderer process (which is what happens if I simple put a breakpoint in the devtools of the renderer window). Is NDB a suitable tool for this?

How can I launch NDB programmatically from the Electron renderer process and then attach to it?

My assumption is that, based on the code above, if i put a breakpoint in component.SomeMethod() it will hit the breakpoint in NDB and NOT freeze the Electron renderer process (the renderer process displays some charting that I need to be usable during breakpoint).

Is that correct or will it have the same effect of freezing the charts as it does when I put a breakpoint directly in the DevTools of the render process?

parliament718 avatar Aug 07 '19 09:08 parliament718