Skip to content

Make embedding + V8 inspector work again #17254

Description

@bnoordhuis

See #16981 (comment).

Commit 9e08695 removed all v8::platform::PumpMessageLoop() calls from the code base.

It's problematic for embedders like electron that plug in their own v8::Platform because they now no longer get notifications from the V8 inspector.

We should probably restore the PumpMessageLoop() calls, even if they're no-ops in normal node builds.

Activity

  1. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    embeddingIssues and PRs related to embedding Node.js in another project.
    on Nov 22, 2017
  2. jasnell commented on Nov 22, 2017

    @jasnell
    Member

    sgtm

  3. refack commented on Nov 22, 2017

    @refack
    Contributor

    +1
    We could coordinate with @zcbenz and rollback 2728112 congruent with this fix.

  4. addaleax commented on Nov 22, 2017

    @addaleax
    Member

    I wouldn’t personally agree with rolling back 2728112. If we want ourselves or embedders to be able to run multiple isolates in a single process in some way, now or at some point in the future, then the default platform is not going to work for that because it doesn’t allow de-registering Isolates.

  5. zcbenz commented on Nov 23, 2017

    @zcbenz
    Contributor

    I would be happy to try whether your fix would work in Electron.

  6. bnoordhuis commented on Nov 23, 2017

    @bnoordhuis
    MemberAuthor

    @zcbenz Can you describe in a few words what the ideal electron + node integration would look like? I remember you used to have trouble integrating with the libuv event loop. Perhaps we can work out something better now.

    If you want something a little less open-ended: who should sit at the bottom of the call stack, node or electron? Who should call uv_run()?

  7. levimm commented on Dec 4, 2017

    @levimm

    @bnoordhuis I'll try to rephrase my issue.
    I'm using v8::platform::CreateDefaultPlatform in embedding and it requires link to v8_libplatform.lib. I get this v8_libplatform.lib by building nodejs v9.0.0. If I upgrade node to 9.1.0, the addon will fail to work since I need to build a new v8_libplatform again.
    I'm not sure if this is the right way of doing this.

  8. MylesBorins commented on Dec 12, 2017

    @MylesBorins
    Contributor

    /cc @nodejs/v8

  9. zcbenz commented on Dec 13, 2017

    @zcbenz
    Contributor

    @zcbenz Can you describe in a few words what the ideal electron + node integration would look like? I remember you used to have trouble integrating with the libuv event loop. Perhaps we can work out something better now.

    Basically we create a new thread to watch events of the backend fd of the uv loop, when there is a new event, we would notify the main thread and call uv_run_once in the main thread.

    A simplified version of node integration can be found at https://github.com/yue/yode/blob/master/src/node_integration.cc.

  10. levimm commented on Feb 26, 2018

    @levimm

    @bnoordhuis Hi, any news on this topic (bring PumpMessageLoop back)?

  11. bnoordhuis commented on Feb 26, 2018

    @bnoordhuis
    MemberAuthor

    @levimm Not at the moment. I don't have time to work on it myself but I can mentor and review pull requests, if you like.

  12. juggernaut451 commented on Feb 26, 2018

    @juggernaut451
    Contributor

    @bnoordhuisI would love to work on. can you please elaborate on this regarding what are the changes that have to be made

  13. bnoordhuis commented on Feb 26, 2018

    @bnoordhuis
    MemberAuthor

    @juggernaut451 Are you embedding Node.js? This issue probably isn't relevant to you if you aren't and hard to explain succinctly because of domain-specific knowledge.

  14. fhinkel commented on Oct 30, 2019

    @fhinkel
    Contributor

    Should this remain open?

  15. bnoordhuis commented on Nov 1, 2019

    @bnoordhuis
    MemberAuthor

    I don't think so, I'll close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.embeddingIssues and PRs related to embedding Node.js in another project.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions