Skip to content
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

src: reduce includes of node_internals.h #25507

Closed
wants to merge 3 commits into from

Conversation

joyeecheung
Copy link
Member

At the moment node_internals.h serves as a header for declarations
of internal APIs that do not have their own headers, so it includes
many other headers for internal types and is subject to frequent
changes, which often trigger recompilations of files that
include node_internals.h and creates a lot of indirect dependencies
on unnecessary headers.

This patch moves the utilities in node_internals.h that
only depends on v8.h into util.h, and reduce the number of includes
of node_internals.h across the code base - most of them can be
replaced with util.h or env-inl.h instead.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung sadly an error occured when I tried to trigger a build :(

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Jan 15, 2019
@joyeecheung
Copy link
Member Author

#include <sstream>
#include <string>
#include "async_wrap.h"
#include "env-inl.h"
Copy link
Member

Choose a reason for hiding this comment

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

Style: own headers before system headers.

(Well, style... it's to avoid accidental dependencies on system headers in our own headers)

#include <string>
#include "util.h"
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

#include <string.h>
#include <algorithm>
#include "util.h"
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

@joyeecheung joyeecheung added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 15, 2019
@bnoordhuis
Copy link
Member

@joyeecheung You added the author-ready label but did you address the feedback?

@joyeecheung
Copy link
Member Author

@bnoordhuis Looks like my push did not succeed (GFW hiccups).

Addressed the reviews and rebased.

CI: https://ci.nodejs.org/job/node-test-pull-request/20190/

@joyeecheung
Copy link
Member Author

joyeecheung commented Jan 19, 2019

Added an additional hack for nghttp2.h so that it compiles on Windows - somehow the <inttypes.h> trick defined there does not work with our CI settings.

https://ci.nodejs.org/job/node-test-pull-request/20206/ (✔️)

@danbev
Copy link
Contributor

danbev commented Jan 21, 2019

Landed in 1838d00.

@danbev danbev closed this Jan 21, 2019
danbev pushed a commit that referenced this pull request Jan 21, 2019
PR-URL: #25507
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Jan 23, 2019
PR-URL: #25507
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. 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.

7 participants