New issue

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

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

Already on GitHub? Sign in to your account

inspector: Allow require in Runtime.evaluate #8837

Closed
wants to merge 3 commits into
base: master
from

Conversation

@jkrems
Contributor

jkrems commented Sep 28, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

inspector

Description of change

Being able to require modules from the console can be very handy while debugging issues. This allows to do it even when require is no longer in scope or the process isn't currently paused. It also creates the foundation for adding other command line API methods in the future (if more use cases come up).

@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Sep 28, 2016

Contributor

I wasn't sure if this warrants a mention in the docs. So far I assume that require is something people will implicitly assume works (the behavior is roughly the same as in the repl / node -e / etc.).

Contributor

jkrems commented Sep 28, 2016

I wasn't sure if this warrants a mention in the docs. So far I assume that require is something people will implicitly assume works (the behavior is roughly the same as in the repl / node -e / etc.).

Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated test/inspector/test-inspector.js
@jasnell

LGTM if CI is happy and @Fishrock123's concerns are met.

Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated src/env.h
Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated lib/internal/bootstrap_node.js
@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Oct 3, 2016

Contributor

Sorry for force-pushing the last couple of times, missed that sentence in the contribution guide.

Pushed a commit to address the last round of feedback.

Contributor

jkrems commented Oct 3, 2016

Sorry for force-pushing the last couple of times, missed that sentence in the contribution guide.

Pushed a commit to address the last round of feedback.

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Oct 3, 2016

Member

@jkrems I don't think force-pushing is a problem, AFAIK it's a matter of personal preference. I like to use --amend so the commits look tidier, but either way should be fine. Which sentence in the contribution guide were you referring to?

Member

gibfahn commented Oct 3, 2016

@jkrems I don't think force-pushing is a problem, AFAIK it's a matter of personal preference. I like to use --amend so the commits look tidier, but either way should be fine. Which sentence in the contribution guide were you referring to?

@ak239

ak239 approved these changes Oct 3, 2016

@ak239

This comment has been minimized.

Show comment
Hide comment
@ak239

ak239 Oct 3, 2016

Member

thanks, lgtm

Member

ak239 commented Oct 3, 2016

thanks, lgtm

Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated src/inspector_agent.cc
@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Oct 3, 2016

Contributor

@gibfahn Here's the quote I was referring to:

If there are comments to address, apply your changes in a separate commit and push that to your branch.

Contributor

jkrems commented Oct 3, 2016

@gibfahn Here's the quote I was referring to:

If there are comments to address, apply your changes in a separate commit and push that to your branch.

@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Oct 17, 2016

Contributor

Anything left to address here?

Contributor

jkrems commented Oct 17, 2016

Anything left to address here?

@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Dec 13, 2016

Contributor

Rebased on origin/master & make -j8 test (the only conflict was another test case that was added to test/inspector/test-inspector.js in the meantime).

Contributor

jkrems commented Dec 13, 2016

Rebased on origin/master & make -j8 test (the only conflict was another test case that was added to test/inspector/test-inspector.js in the meantime).

Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated lib/internal/bootstrap_node.js
Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated test/inspector/test-inspector.js
@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Dec 13, 2016

Member

@jkrems FYI, this is no longer in CONTIBUTING.md, so feel free to squash or not, whatever you prefer...

Member

gibfahn commented Dec 13, 2016

@jkrems FYI, this is no longer in CONTIBUTING.md, so feel free to squash or not, whatever you prefer...

@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Dec 13, 2016

Contributor

Updated, went with adding it as another commit because consistency.

Contributor

jkrems commented Dec 13, 2016

Updated, went with adding it as another commit because consistency.

@jasnell jasnell added the stalled label Mar 1, 2017

@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Mar 23, 2017

Contributor
  • Fixed the naming issue @bnoordhuis pointed out
  • Squashed and rebased against latest master to make sure it still merges cleanly
  • Reran make test (passes)
Contributor

jkrems commented Mar 23, 2017

  • Fixed the naming issue @bnoordhuis pointed out
  • Squashed and rebased against latest master to make sure it still merges cleanly
  • Reran make test (passes)
@bnoordhuis

The setupInspectorAPI -> setupInspectorCommandLineAPI thing is still unaddressed but GH won't let me comment on it inline for some reason.

Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated src/inspector_agent.cc
Show outdated Hide outdated lib/internal/bootstrap_node.js
@jkrems

This comment has been minimized.

Show comment
Hide comment
@jkrems

jkrems Jul 25, 2017

Contributor

I do think consistency between the REPL and the Inspector console is important.

That's definitely true! :) Unfortunately I'm about to be sidetracked by some work-related stuff soon so I'm not sure when I'll get around to work on those changes & the associated test cases to make sure the extended require.* API works as expected.

Given that this would put this PR into hibernation once more, I'd vote to just close this for now and cut our losses. It's a fairly minor QoL improvement and it has now consumed at least some amount of time for more than a handful of people. Maybe somebody with more experience with node who can anticipate the general feedback a bit better will be able to pick this up eventually..?

Contributor

jkrems commented Jul 25, 2017

I do think consistency between the REPL and the Inspector console is important.

That's definitely true! :) Unfortunately I'm about to be sidetracked by some work-related stuff soon so I'm not sure when I'll get around to work on those changes & the associated test cases to make sure the extended require.* API works as expected.

Given that this would put this PR into hibernation once more, I'd vote to just close this for now and cut our losses. It's a fairly minor QoL improvement and it has now consumed at least some amount of time for more than a handful of people. Maybe somebody with more experience with node who can anticipate the general feedback a bit better will be able to pick this up eventually..?

@jkrems jkrems closed this Jul 25, 2017

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Jul 25, 2017

Member

I'm willing to take this up and fix whatever is needed to get this in, so reopening.

Member

TimothyGu commented Jul 25, 2017

I'm willing to take this up and fix whatever is needed to get this in, so reopening.

@TimothyGu TimothyGu reopened this Jul 25, 2017

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu
Member

TimothyGu commented Jul 25, 2017

Show outdated Hide outdated lib/internal/bootstrap_node.js

@TimothyGu TimothyGu self-assigned this Jul 31, 2017

@TimothyGu TimothyGu removed the stalled label Jul 31, 2017

@TimothyGu

This comment has been minimized.

Show comment
Hide comment

jkrems and others added some commits Sep 28, 2016

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Aug 6, 2017

Member

Rebased. I intend to land this soon if CI doesn't have any problems with that.

CI: https://ci.nodejs.org/job/node-test-commit/11573/

Member

TimothyGu commented Aug 6, 2017

Rebased. I intend to land this soon if CI doesn't have any problems with that.

CI: https://ci.nodejs.org/job/node-test-commit/11573/

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Aug 7, 2017

Member

Landed in 5fd2f03.

Member

TimothyGu commented Aug 7, 2017

Landed in 5fd2f03.

@TimothyGu TimothyGu closed this Aug 7, 2017

TimothyGu added a commit that referenced this pull request Aug 7, 2017

inspector: allow require in Runtime.evaluate
Some parts were written by Timothy Gu <timothygu99@gmail.com>.

PR-URL: #8837
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>

@jkrems jkrems deleted the jkrems:jk-global-require branch Aug 7, 2017

addaleax added a commit that referenced this pull request Aug 10, 2017

inspector: allow require in Runtime.evaluate
Some parts were written by Timothy Gu <timothygu99@gmail.com>.

PR-URL: #8837
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>

icarter09 added a commit to icarter09/node that referenced this pull request Aug 12, 2017

inspector: allow require in Runtime.evaluate
Some parts were written by Timothy Gu <timothygu99@gmail.com>.

PR-URL: nodejs#8837
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>

addaleax added a commit that referenced this pull request Aug 13, 2017

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](#8837)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for readable the readable and the writable side.
    [#14636](#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](#14558)

@addaleax addaleax referenced this pull request Aug 13, 2017

Merged

v8.4.0 proposal #14811

addaleax added a commit that referenced this pull request Aug 13, 2017

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](#8837)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](#14558)

PR-URL: #14811

addaleax added a commit that referenced this pull request Aug 14, 2017

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](#14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](#8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](#14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](#14558)

PR-URL: #14811

evanlucas added a commit that referenced this pull request Aug 15, 2017

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](#14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](#8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](#14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](#14558)

PR-URL: #14811

MSLaguana added a commit to nodejs/node-chakracore that referenced this pull request Aug 21, 2017

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](nodejs/node#14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](nodejs/node#8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](nodejs/node#14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](nodejs/node#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](nodejs/node#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](nodejs/node#14558)

PR-URL: nodejs/node#14811
@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Jan 15, 2018

Member

Release team were -1 on landing on v6.x, if you disagree let us know.

Member

gibfahn commented Jan 15, 2018

Release team were -1 on landing on v6.x, if you disagree let us know.

gabrielschulhof added a commit to gabrielschulhof/node that referenced this pull request Mar 12, 2018

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](nodejs#14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](nodejs#8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](nodejs#14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](nodejs#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](nodejs#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](nodejs#14558)

This applies parts of 1fe0741 that are
relevant to N-API.

PR-URL: nodejs#14811

gabrielschulhof added a commit to gabrielschulhof/node that referenced this pull request Mar 15, 2018

2017-08-15, Version 8.4.0 (Current)
Notable changes

* **HTTP2**
  * Experimental support for the built-in `http2` has been added via the
    `--expose-http2` flag.
    [#14239](nodejs#14239)

* **Inspector**
  * `require()` is available in the inspector console now.
    [#8837](nodejs#8837)
  * Multiple contexts, as created by the `vm` module, are supported now.
    [#14465](nodejs#14465)

* **N-API**
  * New APIs for creating number values have been introduced.
    [#14573](nodejs#14573)

* **Stream**
  * For `Duplex` streams, the high water mark option can now be set
    independently for the readable and the writable side.
    [#14636](nodejs#14636)

* **Util**
  * `util.format` now supports the `%o` and `%O` specifiers for printing
    objects.
    [#14558](nodejs#14558)

This applies parts of 1fe0741 that are
relevant to N-API.

PR-URL: nodejs#14811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment