Skip to content

Commit

Permalink
Merge branch 'v2' into lettertwo/cache-large-blob
Browse files Browse the repository at this point in the history
* upstream/v2:
  Upgrade Flow to 0.164.0 (#7297)
  Chore: fix typo initialise -> initialize in core/Parcel.js (#7309)
  Register symbols even without scopehoisting (#7222)
  • Loading branch information
lettertwo committed Nov 18, 2021
2 parents 63f6f2c + 3eb0fc7 commit 50dfd3b
Show file tree
Hide file tree
Showing 22 changed files with 1,487 additions and 949 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Expand Up @@ -36,4 +36,4 @@ untyped-import
untyped-type-import

[version]
0.161.0
0.164.0
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -41,7 +41,7 @@
"@types/node": "^15.12.4",
"cross-env": "^7.0.0",
"eslint": "^7.20.0",
"flow-bin": "0.161.0",
"flow-bin": "0.164.0",
"glob": "^7.1.6",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/core/src/BundleGraph.js
Expand Up @@ -1491,7 +1491,9 @@ export default class BundleGraph {
if (!resolved) continue;
let exported = this.getExportedSymbols(resolved, boundary)
.filter(s => s.exportSymbol !== 'default')
.map(s => ({...s, exportAs: s.exportSymbol}));
.map(s =>
s.exportSymbol !== '*' ? {...s, exportAs: s.exportSymbol} : s,
);
symbols.push(...exported);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/Parcel.js
Expand Up @@ -399,7 +399,7 @@ export default class Parcel {
_getResolvedParcelOptions(): ParcelOptions {
return nullthrows(
this.#resolvedOptions,
'Resolved options is null, please let parcel initialise before accessing this.',
'Resolved options is null, please let parcel initialize before accessing this.',
);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/core/core/src/serializer.js
Expand Up @@ -7,10 +7,10 @@ export let serializeRaw = v8.serialize;
// $FlowFixMe - Flow doesn't know about this method yet
export let deserializeRaw = v8.deserialize;

const nameToCtor: Map<string, Class<*>> = new Map();
const ctorToName: Map<Class<*>, string> = new Map();
const nameToCtor: Map<string, Class<any>> = new Map();
const ctorToName: Map<Class<any>, string> = new Map();

export function registerSerializableClass(name: string, ctor: Class<*>) {
export function registerSerializableClass(name: string, ctor: Class<any>) {
if (ctorToName.has(ctor)) {
throw new Error('Class already registered with serializer');
}
Expand All @@ -19,7 +19,7 @@ export function registerSerializableClass(name: string, ctor: Class<*>) {
ctorToName.set(ctor, name);
}

export function unregisterSerializableClass(name: string, ctor: Class<*>) {
export function unregisterSerializableClass(name: string, ctor: Class<any>) {
if (nameToCtor.get(name) === ctor) {
nameToCtor.delete(name);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/core/core/src/utils.js
Expand Up @@ -67,7 +67,8 @@ export function registerCoreWithSerializer() {
Graph,
ParcelConfig,
RequestGraph,
}): Array<[string, Class<*>]>)) {
// $FlowFixMe[unclear-type]
}): Array<[string, Class<any>]>)) {
registerSerializableClass(packageVersion + ':' + name, ctor);
}

Expand Down
@@ -0,0 +1,4 @@
import {foo} from 'bar';
const { bar } = require("bar");

export default foo(2) + bar();
@@ -0,0 +1,3 @@
import {foo} from 'bar';

export default foo(2);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 50dfd3b

Please sign in to comment.