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

Move ESM loaders off-thread #44710

Merged
merged 126 commits into from
Apr 13, 2023

Commits on Apr 12, 2023

  1. esm: move hook execution to separate thread

    Co-authored-by: Antoine du Hamel <[email protected]>
    Co-authored-by: Geoffrey Booth <[email protected]>
    Co-authored-by: Michaël Zasso <[email protected]>
    4 people committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    03f6bb4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0bb205 View commit details
    Browse the repository at this point in the history
  3. port updates to worker_thread

    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    cd16ccd View commit details
    Browse the repository at this point in the history
  4. move HooksProxy to hooks.js

    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    01f1191 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5f02297 View commit details
    Browse the repository at this point in the history
  6. fix startup issues in hooks worker

    Hooks initialisation has a cart-before-the-horse issue (see fixme in worker)
    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    820aa55 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    231b964 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ed412d5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4776a6d View commit details
    Browse the repository at this point in the history
  10. WIP: convert resolve to sync

    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    2aed49a View commit details
    Browse the repository at this point in the history
  11. Fix test

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    78a2889 View commit details
    Browse the repository at this point in the history
  12. Restore parentURL validation to defaultResolve (and therefore also to…

    … import.meta.resolve)
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    5746d17 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c1afb3d View commit details
    Browse the repository at this point in the history
  14. Rename #hooks to #chains

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    666ee10 View commit details
    Browse the repository at this point in the history
  15. Subclass customized module loader

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    8198a13 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    2d39e13 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    dd6a5d3 View commit details
    Browse the repository at this point in the history
  18. fs.write(1, message) works at least in Mac and Windows for printing f…

    …rom inside a worker
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    1415d6e View commit details
    Browse the repository at this point in the history
  19. Standardize names, fix lint

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    a374bd1 View commit details
    Browse the repository at this point in the history
  20. Exceptions thrown inside loader hooks should be returned to the main …

    …thread and rethrown there so that they're printed in stdout
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    98b5512 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    7be92f3 View commit details
    Browse the repository at this point in the history
  22. Send loader initialization errors up to the main thread so they can b…

    …e thrown and printed
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    382753a View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    2b3e6a5 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    c73001f View commit details
    Browse the repository at this point in the history
  25. Add error handling around hooks method responses being undefined or h…

    …ooks method responses being too large when serialized
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    b4cccd4 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    b272d31 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    0ec518a View commit details
    Browse the repository at this point in the history
  28. Fix import.meta.resolve

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    11c1471 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    0dd5114 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    d15b425 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    b796c02 View commit details
    Browse the repository at this point in the history
  32. unlock worker thread

    use postMessage from the main thread instead of atomics to signal the worker
    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    599a616 View commit details
    Browse the repository at this point in the history
  33. use syncCommPort to exchange data too

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    42d485e View commit details
    Browse the repository at this point in the history
  34. fix --import

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    8e3e0c6 View commit details
    Browse the repository at this point in the history
  35. fix doclint

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    76e23d8 View commit details
    Browse the repository at this point in the history
  36. remove internal check

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    75fe62b View commit details
    Browse the repository at this point in the history
  37. refactor worker exception handling

    It's possible to throw/reject with anything (not only instances of Error)
    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    350351f View commit details
    Browse the repository at this point in the history
  38. errors during load should just be rethrown

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    f3b2ed9 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    7e79b2f View commit details
    Browse the repository at this point in the history
  40. nits

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    c0142d6 View commit details
    Browse the repository at this point in the history
  41. nits

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    5d7e3b4 View commit details
    Browse the repository at this point in the history
  42. fix linter errors

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    685590c View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    49a4088 View commit details
    Browse the repository at this point in the history
  44. Wrap messages passed from worker to main thread so that we can carry …

    …along and restore the extra properties of Error objects
    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    d40834d View commit details
    Browse the repository at this point in the history
  45. Emit experimental warning only once

    GeoffreyBooth authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    47bd0bf View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    17ff524 View commit details
    Browse the repository at this point in the history
  47. fix linter errors

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    2065222 View commit details
    Browse the repository at this point in the history
  48. transfer ArrayBuffers

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    b0cc21f View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    29d019f View commit details
    Browse the repository at this point in the history
  50. chaining loader hooks

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    8706cbd View commit details
    Browse the repository at this point in the history
  51. make things more consistent

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    04ebc5c View commit details
    Browse the repository at this point in the history
  52. remove unnecessary parenthesis

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    8aae17e View commit details
    Browse the repository at this point in the history
  53. simplify error cloning

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    b74dcaa View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    3312b1c View commit details
    Browse the repository at this point in the history
  55. skip already cloned properties

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    7e8be7c View commit details
    Browse the repository at this point in the history
  56. DRY

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    7b7e5be View commit details
    Browse the repository at this point in the history
  57. fix test-esm-loader-chaining

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    3f4c9bf View commit details
    Browse the repository at this point in the history
  58. update docs

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    140c03b View commit details
    Browse the repository at this point in the history
  59. fix waitAsync usage

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    020b9d7 View commit details
    Browse the repository at this point in the history
  60. simplify ArrayBuffer transfer

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    6899203 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    9d392ef View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    1c7dd71 View commit details
    Browse the repository at this point in the history
  63. rework docs

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    acfa8d9 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    1821301 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    b1dcccc View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    0cfc683 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    7fd6fa1 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    a3982ee View commit details
    Browse the repository at this point in the history
  69. only count async messages

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    47b4d83 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    d518e53 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    531c9a3 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    3bcf18c View commit details
    Browse the repository at this point in the history
  73. linter fixes

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    b071a89 View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    0911d15 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    0b1c22b View commit details
    Browse the repository at this point in the history
  76. Configuration menu
    Copy the full SHA
    88686f5 View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    1b1583e View commit details
    Browse the repository at this point in the history
  78. lazy load esmLoader

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    3f4934a View commit details
    Browse the repository at this point in the history
  79. nits

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    800d151 View commit details
    Browse the repository at this point in the history
  80. fix test-esm-loader

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    a5a798b View commit details
    Browse the repository at this point in the history
  81. unref worker more often

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    f9371ae View commit details
    Browse the repository at this point in the history
  82. add more comments

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    0b79809 View commit details
    Browse the repository at this point in the history
  83. Configuration menu
    Copy the full SHA
    0cfec42 View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    281e943 View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    3e31a1c View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    595a95f View commit details
    Browse the repository at this point in the history
  87. Revert "unref worker more often"

    This reverts commit 93d01be.
    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    10bf7b8 View commit details
    Browse the repository at this point in the history
  88. nits

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    106b400 View commit details
    Browse the repository at this point in the history
  89. Configuration menu
    Copy the full SHA
    cc9373a View commit details
    Browse the repository at this point in the history
  90. fix lint

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    a67af11 View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    aab57d7 View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    638b497 View commit details
    Browse the repository at this point in the history
  93. s/BORED/IDLE/

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    e340d24 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    018ab18 View commit details
    Browse the repository at this point in the history
  95. add definition for idleness

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    80cd74c View commit details
    Browse the repository at this point in the history
  96. Update doc/api/esm.md

    Co-authored-by: Michaël Zasso <[email protected]>
    aduh95 and targos committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    817d0e8 View commit details
    Browse the repository at this point in the history
  97. Update lib/internal/modules/esm/shared_constants.js

    Co-authored-by: Jacob Smith <[email protected]>
    aduh95 and JakobJingleheimer committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    0590df4 View commit details
    Browse the repository at this point in the history
  98. add/fix comments + nits

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    cee03fa View commit details
    Browse the repository at this point in the history
  99. for..of -> classic for

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    258cf8a View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    8863cb9 View commit details
    Browse the repository at this point in the history
  101. add explanation for how process.cwd() can fail

    Co-authored-by: Antoine du Hamel <[email protected]>
    JakobJingleheimer and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    13f3d8d View commit details
    Browse the repository at this point in the history
  102. Apply suggestions from code review

    Co-authored-by: Jacob Smith <[email protected]>
    aduh95 and JakobJingleheimer committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    4731362 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    12717f7 View commit details
    Browse the repository at this point in the history
  104. fix dead lock

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    61ad2a5 View commit details
    Browse the repository at this point in the history
  105. Apply suggestions from code review

    Co-authored-by: Jordan Harband <[email protected]>
    aduh95 and ljharb committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    fa29a70 View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    159ca6f View commit details
    Browse the repository at this point in the history
  107. Configuration menu
    Copy the full SHA
    b4a8a2f View commit details
    Browse the repository at this point in the history
  108. add comment

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    6177afa View commit details
    Browse the repository at this point in the history
  109. Configuration menu
    Copy the full SHA
    a85288d View commit details
    Browse the repository at this point in the history
  110. Configuration menu
    Copy the full SHA
    be8090e View commit details
    Browse the repository at this point in the history
  111. Configuration menu
    Copy the full SHA
    f6679bc View commit details
    Browse the repository at this point in the history
  112. Configuration menu
    Copy the full SHA
    722fd0e View commit details
    Browse the repository at this point in the history
  113. fix rare deadlock

    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    544bf89 View commit details
    Browse the repository at this point in the history
  114. Configuration menu
    Copy the full SHA
    88f9042 View commit details
    Browse the repository at this point in the history
  115. chore: de-lint md

    JakobJingleheimer authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    6d8bfc6 View commit details
    Browse the repository at this point in the history
  116. Configuration menu
    Copy the full SHA
    31e7d5d View commit details
    Browse the repository at this point in the history
  117. fix loaders with node:fs

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    372065e View commit details
    Browse the repository at this point in the history
  118. use more writeSync

    targos authored and aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    244f916 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    bc8e970 View commit details
    Browse the repository at this point in the history
  120. resolve TODOs for edge cases

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    f44a246 View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    221f2e2 View commit details
    Browse the repository at this point in the history
  122. Configuration menu
    Copy the full SHA
    9436c97 View commit details
    Browse the repository at this point in the history
  123. fix race condition?

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    ad73db6 View commit details
    Browse the repository at this point in the history
  124. Configuration menu
    Copy the full SHA
    95052c6 View commit details
    Browse the repository at this point in the history
  125. Update lib/internal/worker.js

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    acc0900 View commit details
    Browse the repository at this point in the history
  126. Update lib/internal/worker.js

    aduh95 committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    f02012f View commit details
    Browse the repository at this point in the history