Skip to content

Commit 5578dfb

Browse files
authored
Update parcel patch to fix generated function overload types (#2565)
1 parent 47fb722 commit 5578dfb

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

patches/@parcel+transformer-typescript-types+2.0.0-nightly.359.patch

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/@parcel/transformer-typescript-types/lib/TSModule.js b/node_modules/@parcel/transformer-typescript-types/lib/TSModule.js
2-
index 981ca7b..6cd9ebb 100644
2+
index 981ca7b..c02862b 100644
33
--- a/node_modules/@parcel/transformer-typescript-types/lib/TSModule.js
44
+++ b/node_modules/@parcel/transformer-typescript-types/lib/TSModule.js
55
@@ -33,7 +33,7 @@ class TSModule {
@@ -11,8 +11,19 @@ index 981ca7b..6cd9ebb 100644
1111
}
1212
}
1313

14+
@@ -52,7 +52,9 @@ class TSModule {
15+
}
16+
17+
addLocal(name, node) {
18+
- this.bindings.set(name, node);
19+
+ const bindings = this.bindings.get(name) || new Set();
20+
+ this.bindings.set(name, bindings);
21+
+ bindings.add(node);
22+
23+
if (name !== 'default') {
24+
this.names.set(name, name);
1425
diff --git a/node_modules/@parcel/transformer-typescript-types/lib/TSModuleGraph.js b/node_modules/@parcel/transformer-typescript-types/lib/TSModuleGraph.js
15-
index f346712..830f180 100644
26+
index f346712..18a476e 100644
1627
--- a/node_modules/@parcel/transformer-typescript-types/lib/TSModuleGraph.js
1728
+++ b/node_modules/@parcel/transformer-typescript-types/lib/TSModuleGraph.js
1829
@@ -48,17 +48,13 @@ class TSModuleGraph {
@@ -37,7 +48,23 @@ index f346712..830f180 100644
3748
}
3849

3950
if (module.used.has(name)) {
40-
@@ -130,8 +126,8 @@ class TSModuleGraph {
51+
@@ -81,10 +77,11 @@ class TSModuleGraph {
52+
return ts.visitEachChild(node, visit, context);
53+
};
54+
55+
- let node = module.bindings.get(name);
56+
-
57+
- if (node) {
58+
- ts.visitEachChild(node, visit, context);
59+
+ let bindings = module.bindings.get(name);
60+
+ if (bindings) {
61+
+ for (let node of bindings) {
62+
+ ts.visitEachChild(node, visit, context);
63+
+ }
64+
}
65+
}
66+
67+
@@ -130,8 +127,8 @@ class TSModuleGraph {
4168

4269
return {
4370
module: m,
@@ -48,15 +75,15 @@ index f346712..830f180 100644
4875
};
4976
}
5077

51-
@@ -223,6 +219,7 @@ class TSModuleGraph {
78+
@@ -223,6 +220,7 @@ class TSModuleGraph {
5279
exportedNames.set(e.name, e.module);
5380
} // Assign unique names across all modules
5481

5582
+ let importedSymbolsToUpdate = [];
5683

5784
for (let m of this.modules.values()) {
5885
for (let [orig, name] of m.names) {
59-
@@ -230,7 +227,13 @@ class TSModuleGraph {
86+
@@ -230,7 +228,13 @@ class TSModuleGraph {
6087
continue;
6188
}
6289

@@ -71,7 +98,7 @@ index f346712..830f180 100644
7198
continue;
7299
}
73100

74-
@@ -242,6 +245,37 @@ class TSModuleGraph {
101+
@@ -242,6 +246,37 @@ class TSModuleGraph {
75102
}
76103
}
77104

0 commit comments

Comments
 (0)