Giter Club home page Giter Club logo

Comments (18)

fonghou avatar fonghou commented on August 27, 2024 1

That's awesome! Looking forward to try it!

Really appreciate your time and effort in developing dirac!

from dirac.

darwin avatar darwin commented on August 27, 2024

I believe all pieces for first-class nodejs support are in place:

  1. you run your nREPL server, with Dirac Agent
  2. you add Dirac runtime into your nodejs app
  3. you can use Dirac DevTools to debug your nodejs app[1]

#3 is very recent addition to DevTools, it should work, but Chrome devs are still fixing bugs.
#2 Dirac runtime should not care if it runs in browser context or nodejs context (I believe)

I have never tried this setup myself. It would be cool to create a sample project for nodejs app working with Dirac. Unfortunately I'm not going to spend time on this task ATM.

[1] https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27

from dirac.

tlightsky avatar tlightsky commented on August 27, 2024

thanks, I shall upgrade my node to new version first

from dirac.

fonghou avatar fonghou commented on August 27, 2024

I just tried it in node 7.4.0 and dirac 1.0.0.

Devtool console prints out a message "Feature :repl cannot be installed. Unsupported browser ."

Here is a screenshot with more details.

screen shot 2017-01-19 at 5 36 46 pm

My guess is that node doesn't has certain browser properties that dirac depends on (btw, cljs devtools also failed to install, above is with cljs devtools feature disabled)

from dirac.

darwin avatar darwin commented on August 27, 2024

we will have to relax this condition:

(and (ua/isChrome) (ua/isVersionOrHigher 47))) ; Chrome 47+

you might try to patch this function and then call dirac.runtime/install! by hand

from dirac.

fonghou avatar fonghou commented on August 27, 2024

@darwin Thanks for the hint!

Hit another dependence on js/document. It looks like part of dirac client code has to be injected into chrome-devtools://devtools/bundled/inspector.html ?

Screenshot

screen shot 2017-01-19 at 7 26 11 pm

from dirac.

darwin avatar darwin commented on August 27, 2024

ok, set *boostrapped?* to true prior install! call:

(def ^:dynamic *boostrapped?* false)

after install call (brepl/bootstrap) by hand

let's see how far you can get...

from dirac.

darwin avatar darwin commented on August 27, 2024

ah, scratch my previous comment, I don't have time to reply now. Maybe you could figure out another way how to implement install! on your own. Maybe set! *boostrapped?* and *installed? to true and call (brepl/bootstrap)

from dirac.

fonghou avatar fonghou commented on August 27, 2024

That didn't allow me to do what you suggested. Instead, I tried to comment out

(call-after-document-finished-loading boostrap-if-needed! 0)))

then call (boostrap-if-needed!) by hand. No error in js console, but dirac console won't start after clicking the button on toolbar.

screen shot 2017-01-19 at 8 04 50 pm

screen shot 2017-01-19 at 8 03 07 pm

from dirac.

darwin avatar darwin commented on August 27, 2024

I was able to make it work here on my Mac. But it will require some deeper changes. I'm pretty confident I will be able to provide an example project configuration by the end of this weekend.

from dirac.

darwin avatar darwin commented on August 27, 2024

Try to upgrade to v1.1.0, basic support should be in place:
https://github.com/binaryage/dirac/releases/tag/v1.1.0

from dirac.

fonghou avatar fonghou commented on August 27, 2024

Hi @darwin, I did a quick test (not setting up external source-map serving yet). Basic feature works. Just want to let you know a few differences.

  1. you said in the doc, REPL eval only works at debugger point. However, my dirac repl seems working even not at debugger point.

  2. i got CLJS DevTools errors when Dirac hits a debugger point.

screen shot 2017-01-22 at 8 08 34 pm

from dirac.

darwin avatar darwin commented on August 27, 2024

Ok, thanks for the feedback. I'm not sure about that REPL eval. Could have been some glitch in my setup.

That CLJS DevTools Error is unrelated to this issue. It is not even CLJS devtools bug. You are likely to see similar stack trace event without cljs-devtools. It looks to me that Promesa throws when someone wants to print its value via IPrintWithWriter protocol.

from dirac.

fonghou avatar fonghou commented on August 27, 2024

Yes, you are right. That's an issue from promesa. will report it there (i did a local fix that works).

Thanks again for your help!

from dirac.

darwin avatar darwin commented on August 27, 2024

Released in v1.1.0.

I don't hear any complaints. Feel free to reopen in case of bug reports.

from dirac.

fonghou avatar fonghou commented on August 27, 2024

This is with dirac node support. Getting

Internal Dirac Error Request Debugger.getPossibleBreakpoints failed. {"code":-32601,"message":"'Debugger.getPossibleBreakpoints' wasn't found"}

It seems triggered asynchronously, as well as when stepping in debugger. Please see sreenshot attached.

screen shot 2017-05-07 at 5 35 25 pm

from dirac.

darwin avatar darwin commented on August 27, 2024

This looks like out-of-sync debugger protocol between Devtools and Node.js.

In case of similar troubles, you should be using nightly builds of node.js:
https://github.com/binaryage/dirac/blob/master/docs/node.md#nodejs-version

from dirac.

fonghou avatar fonghou commented on August 27, 2024

Yes, that seems the case. Thanks!

from dirac.

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.