lib: make internal/options lazy by joyeecheung · Pull Request #38993 · nodejs/node

@joyeecheung

This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

@github-actions bot added the needs-ci

PRs that need a full CI run.

label

Jun 10, 2021

@joyeecheung

bl-ue

@Lxxyx Lxxyx added request-ci

Add this label to start a Jenkins CI on a PR.

and removed needs-ci

PRs that need a full CI run.

labels

Jun 11, 2021

@Lxxyx Lxxyx added lib / src

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

request-ci

Add this label to start a Jenkins CI on a PR.

labels

Jun 11, 2021

joyeecheung added a commit that referenced this pull request

Jun 21, 2021
This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

PR-URL: #38993
Refs: #35711
Refs: #38905
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

danielleadams pushed a commit that referenced this pull request

Jun 21, 2021
This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

PR-URL: #38993
Refs: #35711
Refs: #38905
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

richardlau pushed a commit that referenced this pull request

Jul 19, 2021
This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

PR-URL: #38993
Refs: #35711
Refs: #38905
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

richardlau pushed a commit that referenced this pull request

Jul 20, 2021
This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

PR-URL: #38993
Refs: #35711
Refs: #38905
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

foxxyz pushed a commit to foxxyz/node that referenced this pull request

Oct 18, 2021
This way, internal modules can still require the module
and cache the function getOptionValue() early (therefore
these code can be included in the snapshots), but the
options map won't be serialized from C++ land until the
option values are actually queried.

PR-URL: nodejs#38993
Refs: nodejs#35711
Refs: nodejs#38905
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>