-
-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not use affected for side-effects-flag-plugin (#7865)
fix: do not use cacheUnaffected for side-effects-flag-plugin
- Loading branch information
Showing
10 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
.../newTreeshaking/re-export-optimization-for-inaffected-module/__snapshots__/web/0.snap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Case re-export-optimization-for-inaffected-module: Step 0 | ||
|
||
## Changed Files | ||
|
||
|
||
## Asset Files | ||
- Bundle: bundle.js | ||
|
||
## Manifest | ||
|
||
|
||
## Update |
58 changes: 58 additions & 0 deletions
58
.../newTreeshaking/re-export-optimization-for-inaffected-module/__snapshots__/web/1.snap.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Case re-export-optimization-for-inaffected-module: Step 1 | ||
|
||
## Changed Files | ||
- module.js | ||
|
||
## Asset Files | ||
- Bundle: bundle.js | ||
- Manifest: main.LAST_HASH.hot-update.json, size: 28 | ||
- Update: main.LAST_HASH.hot-update.js, size: 616 | ||
|
||
## Manifest | ||
|
||
### main.LAST_HASH.hot-update.json | ||
|
||
```json | ||
{"c":["main"],"r":[],"m":[]} | ||
``` | ||
|
||
|
||
## Update | ||
|
||
|
||
### main.LAST_HASH.hot-update.js | ||
|
||
#### Changed Modules | ||
- ./module.js | ||
|
||
#### Changed Runtime Modules | ||
- webpack/runtime/get_full_hash | ||
|
||
#### Changed Content | ||
```js | ||
"use strict"; | ||
self["webpackHotUpdate"]('main', { | ||
"./module.js": (function (__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
__webpack_require__.r(__webpack_exports__); | ||
__webpack_require__.d(__webpack_exports__, { | ||
value: function() { return value; } | ||
}); | ||
/* harmony import */var _reexports__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reexports */ "./foo.js"); | ||
|
||
const value = '' + _reexports__WEBPACK_IMPORTED_MODULE_0__.v; | ||
|
||
|
||
}), | ||
|
||
},function(__webpack_require__) { | ||
// webpack/runtime/get_full_hash | ||
(() => { | ||
__webpack_require__.h = function () { | ||
return "CURRENT_HASH"; | ||
}; | ||
|
||
})(); | ||
|
||
} | ||
); | ||
``` |
1 change: 1 addition & 0 deletions
1
...t-tools/tests/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/foo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const v = 'foo' |
16 changes: 16 additions & 0 deletions
16
...tools/tests/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {value} from "./module"; | ||
|
||
let v = value; | ||
module.hot.accept('./module', () => { | ||
v = value | ||
}); | ||
|
||
it("should auto-reexport an ES6 imported value on accept with newTreeshaking", async function (done) { | ||
expect(v).toBe("foo"); | ||
NEXT( | ||
require("../../update")(done, true, () => { | ||
expect(v).toBe("foo"); | ||
done(); | ||
}) | ||
); | ||
}); |
6 changes: 6 additions & 0 deletions
6
...ools/tests/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {v} from './reexports' | ||
// | ||
export const value = '' + v; | ||
--- | ||
import {v} from './reexports' | ||
export const value = '' + v; |
1 change: 1 addition & 0 deletions
1
...s/tests/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
2 changes: 2 additions & 0 deletions
2
...ts/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/reexports-deep.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import {v} from './foo'; | ||
export {v}; |
1 change: 1 addition & 0 deletions
1
...s/tests/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/reexports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { v } from "./reexports-deep"; |
12 changes: 12 additions & 0 deletions
12
...sts/hotCases/newTreeshaking/re-export-optimization-for-inaffected-module/rspack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
optimization: { | ||
sideEffects: true, | ||
providedExports: true, | ||
}, | ||
experiments: { | ||
rspackFuture: { | ||
newIncremental: true | ||
} | ||
} | ||
}; |
ef82144
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
ef82144
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open