FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: refactor console bootstrap by BridgeAR · Pull Request #15111 · nodejs/node · GitHub

/ node Public

lib: refactor console bootstrap - #15111

Closed
BridgeAR wants to merge 3 commits into
nodejs:masterfrom
BridgeAR:refactor-console-bootstrap
Closed

lib: refactor console bootstrap#15111
BridgeAR wants to merge 3 commits into
nodejs:masterfrom
BridgeAR:refactor-console-bootstrap

Conversation

Copy link
Copy Markdown
Member

Console setup is currently more complicated then it has to be. I refactored it to be more straight forward.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

lib, test

nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Aug 31, 2017

Copy link
Copy Markdown
Member

has nodejs/help#778 been fixed otherwise in the last 19 days?

Can you explain why da1af3d is no longer required?

benjamingr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Requesting changes so I don't forget this

Copy link
Copy Markdown
Member Author

For question 1 please look at #15110 (it was only seemingly fixed but not really fixed).

The initiation of global.console is not necessary anymore because that was originally done in the get of global.console and now it is done right away. That is why the test added by da1af3d continues to "work".

benjamingr dismissed their stale review August 31, 2017 07:53

addressed

Copy link
Copy Markdown
Member

Thanks, cc @bnoordhuis

addaleax self-requested a review August 31, 2017 13:25

Fishrock123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

little unsure why some bits were changed?

if (browserGlobals) {
setupGlobalTimeouts();
setupGlobalConsole();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It is desirable to load the console first for debugging reasons.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well that is a bit tricky if we want to instantiate it eagerly without the get call to do the Instantiation because internal/process/stdio has to be loaded first. Would it be fine to move the necessary part up that load stdio and keep the eager instantiation?

const browserGlobals = !process._noBrowserGlobals;
if (browserGlobals) {
// Instantiate eagerly in case the first call is under stack overflow
// conditions where instantiation doesn't work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The previous commit here still seems valid...?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Somewhat yes, but it did not fully work as anticipated and therefore I think it is fine to remove the comment. I can add the comment back in if you like though.

Comment thread lib/internal/bootstrap_node.js Outdated
const originalConsole = global.console;
let console;
// Setup inspector command line API
const { addCommandLineAPI, consoleCall } = process.binding('inspector');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

needs if (!addCommandLineAPI) return;?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh, you are right, this part should be moved below the if (!consoleCall) statement. That should be sufficient.

const consoleAPIModule = new Module('<inspector console>');
consoleAPIModule.paths =
Module._nodeModulePaths(cwd).concat(Module.globalPaths);
addCommandLineAPI('require', makeRequireFunction(consoleAPIModule));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is frankly unrelated to console instantiation. I'd prefer it to be moved out of console bootstrapping.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I combined them because it was the only function calling the inspector. But I split them and the inspector part is now separated.

jasnell requested a review from bnoordhuis September 1, 2017 17:42
nodejs deleted a comment Sep 3, 2017
nodejs deleted a comment Sep 3, 2017
nodejs deleted a comment Sep 3, 2017

BridgeAR commented Sep 8, 2017

Copy link
Copy Markdown
Member Author

@Fishrock123 @TimothyGu PTAL

Copy link
Copy Markdown
Member Author

@nodejs/collaborators PTAL

BridgeAR commented Sep 15, 2017
edited
Loading

Copy link
Copy Markdown
Member Author

Since this should actually also fix a bug (see #15008 (comment)) it would be nice to get some reviews.

targos commented Sep 18, 2017

Copy link
Copy Markdown
Member

LGTM if CI is happy

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member Author

Landed in 4bcb1c3

BridgeAR closed this Sep 19, 2017
BridgeAR added a commit that referenced this pull request Sep 19, 2017
PR-URL: #15111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
jasnell pushed a commit that referenced this pull request Sep 20, 2017
PR-URL: #15111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
PR-URL: nodejs/node#15111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
PR-URL: nodejs/node#15111
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
apapirovski added a commit to apapirovski/node that referenced this pull request Oct 15, 2017
Previously, console had to be compiled in case it was not available
but this is no longer necessary - remove it.

Refs: nodejs#15111
apapirovski added a commit to apapirovski/node that referenced this pull request Oct 21, 2017
Previously, console had to be compiled in case it was not available
but this is no longer necessary - remove it.

PR-URL: nodejs#16212
Refs: nodejs#15111
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 26, 2017
Previously, console had to be compiled in case it was not available
but this is no longer necessary - remove it.

PR-URL: nodejs/node#16212
Refs: nodejs/node#15111
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
Previously, console had to be compiled in case it was not available
but this is no longer necessary - remove it.

PR-URL: nodejs/node#16212
Refs: nodejs/node#15111
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>

Copy link
Copy Markdown
Member Author

I do not see much benefit to backport this, so I changed the label accordingly.

BridgeAR deleted the refactor-console-bootstrap branch April 1, 2019 23:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL