GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix a bug which causes incorrect providedExports for cached modules · webpack/webpack@2f4296e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • FlagDependencyExportsPlugin.js
  • test/watchCases/parsing/reexport-chain
    • 0
      • a.js
      • b.js
      • c.js
      • index.js
    • 1
      • c.js
    • 2
      • a.js
      • c.js
  • yarn.lock
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/FlagDependencyExportsPlugin.js‎

Copy file name to clipboardExpand all lines: lib/FlagDependencyExportsPlugin.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class FlagDependencyExportsPlugin {
3232
let module;
3333
let moduleWithExports;
3434
let moduleProvidedExports;
35+
let providedExportsAreTemporary;
3536

3637
const processDependenciesBlock = depBlock => {
3738
for (const dep of depBlock.dependencies) {
@@ -72,6 +73,7 @@ class FlagDependencyExportsPlugin {
7273
// store dependencies
7374
const exportDeps = exportDesc.dependencies;
7475
if (exportDeps) {
76+
providedExportsAreTemporary = true;
7577
for (const exportDependency of exportDeps) {
7678
// add dependency for this module
7779
const set = dependencies.get(exportDependency);
@@ -96,7 +98,12 @@ class FlagDependencyExportsPlugin {
9698

9799
// Start with all modules without provided exports
98100
for (const module of modules) {
99-
if (!module.buildMeta.providedExports) {
101+
if (module.buildInfo.temporaryProvidedExports) {
102+
// Clear exports when they are temporary
103+
// and recreate them
104+
module.buildMeta.providedExports = null;
105+
queue.enqueue(module);
106+
} else if (!module.buildMeta.providedExports) {
100107
queue.enqueue(module);
101108
}
102109
}
@@ -112,7 +119,9 @@ class FlagDependencyExportsPlugin {
112119
)
113120
? new Set(module.buildMeta.providedExports)
114121
: new Set();
122+
providedExportsAreTemporary = false;
115123
processDependenciesBlock(module);
124+
module.buildInfo.temporaryProvidedExports = providedExportsAreTemporary;
116125
if (!moduleWithExports) {
117126
module.buildMeta.providedExports = true;
118127
notifyDependencies();
Collapse file

‎test/watchCases/parsing/reexport-chain/0/a.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./b";
Collapse file

‎test/watchCases/parsing/reexport-chain/0/b.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./c";
Collapse file

‎test/watchCases/parsing/reexport-chain/0/c.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export var x0 = "0";
Collapse file

‎test/watchCases/parsing/reexport-chain/0/index.js‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as a from "./a";
2+
3+
const nsObj = m => {
4+
Object.defineProperty(m, Symbol.toStringTag, { value: "Module" });
5+
return m;
6+
};
7+
8+
it("should have to correct exports", () => {
9+
expect(a).toEqual(nsObj({
10+
[`x${WATCH_STEP}`]: WATCH_STEP
11+
}));
12+
})
Collapse file

‎test/watchCases/parsing/reexport-chain/1/c.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export var x1 = "1";
Collapse file

‎test/watchCases/parsing/reexport-chain/2/a.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./c";
Collapse file

‎test/watchCases/parsing/reexport-chain/2/c.js‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export var x2 = "2";
Collapse file

‎yarn.lock‎

Copy file name to clipboardExpand all lines: yarn.lock
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5823,6 +5823,7 @@ p-try@^1.0.0:
58235823
p-try@^2.0.0:
58245824
version "2.0.0"
58255825
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1"
5826+
integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==
58265827

58275828
pako@~1.0.5:
58285829
version "1.0.6"
@@ -6579,6 +6580,7 @@ pump@^2.0.0:
65796580
pump@^3.0.0:
65806581
version "3.0.0"
65816582
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
6583+
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
65826584
dependencies:
65836585
end-of-stream "^1.1.0"
65846586
once "^1.3.1"

0 commit comments

Comments
0 (0)
You are visitor 01402639 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.