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

Normalize object literal shorthand even when wrapped #8155

Merged
merged 2 commits into from May 29, 2022

Conversation

mischnic
Copy link
Member

Closes #7955

Even when the asset is wrapped because of exports = , object literal shorthands need to be normlized otherwise

const cjsA = require("./cjsA.js");
const registry = {
  cjsA,
};
exports = module.exports = registry.cjsA;

becomes

var $dbGhw = parcelRequire("dbGhw");
const registry = {
  $dbGhw
};
exports = module.exports = registry.cjsA;

@parcel-benchmark
Copy link

parcel-benchmark commented May 28, 2022

Benchmark Results

Kitchen Sink 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

React HackerNews ✅

Timings

Description Time Difference
Cold 8.64s -63.00ms
Cached 429.00ms +6.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.42m +270.00ms
Cached 2.30s +20.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/esm.c7dc1640.js 61.96kb +0.00b 34.82s -28.13s 🚀
dist/workerHasher.e50d242f.js 1.72kb +0.00b 34.82s -28.13s 🚀
dist/16.1969624f.js 1.08kb +0.00b 31.41s -2.83s 🚀
dist/16.069344b7.js 905.00b +0.00b 31.42s -2.83s 🚀
dist/simpleHasher.46d6f2e5.js 742.00b +0.00b 34.82s -28.13s 🚀
dist/index.html 240.00b +0.00b 27.58s -35.41s 🚀

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 6.29s +35.00ms
Cached 259.00ms -6.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 3b3b135 into v2 May 29, 2022
@devongovett devongovett deleted the 7955-wrapped-obj-shorthand branch May 29, 2022 01:51
gorakong pushed a commit that referenced this pull request Nov 3, 2022
* upstream/v2:
  Normalize object literal shorthand even when wrapped (#8155)
  add invalidateOnEnvChange to resolver (#8103)
  Apply unresolved mark to inserted `undefined` identifiers (#8151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parcel build corrupts object literal property value shorthand logic but not parcel watch
3 participants