-
-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: concatenate plugin part one (#5237)
* chore: π€ ck point * chore: π€ ck point * chore: π€ ck point * chore: π€ ck point * chore: π€ replace all atoms as JsWord * chore: π€ concatenation scope * chore: π€ ck point * chore: π€ remove tmp file * chore: π€ ck point * chore: π€ fix compilation err * chore: π€ reserved_names * chore: π€ build * chore: π€ lint * chore: π€ move concatenation scope * chore: π€ pass concate scope * chore: π€ make it can pass concatenation scope * chore: π€ reset concatenation scope * chore: π€ push error * chore: π€ parse js source file * chore: π€ update module after analyze module * chore: π€ create concatenation list * chore: π€ get module with info * chore: π€ collect all ident * chore: π€ ck point * chore: π€ ck point * chore: π€ get final binding * chore: π€ remove unnecessary branch * chore: π€ update doc * chore: π€ generate all used names * chore: π€ remove temp file * chore: π€ rename in concatenate module * chore: π€ basic return * feat: πΈ create concate module * feat: πΈ concatenate module build * feat: πΈ clone attrs * feat: πΈ copy outgoing module * feat: πΈ chunk graph replace module * chore: π€ remove redundant main * feat: πΈ add module * feat: πΈ add config * chore: π€ ckpoint * feat: πΈ ck point * chore: π€ remove temp file * feat: πΈ incomming from modules * chore: π€ no harmony connection * chore: π€ basic work * chore: π€ recover * chore: π€ make it right * feat: πΈ scope for harmony import specifier * feat: πΈ export specifier * feat: πΈ finish codegen * fix: π update connection * fix: π compile error * chore: π€ lint * chore: π€ lint * chore: π€ ck point * chore: π€ ck point * chore: π€ lint * chore: π€ ck point * feat: πΈ update concate source * chore: π€ replace in chunk * feat: πΈ update snap * fix: π depth deduplicated * chore: π€ update depth * chore: π€ update compatibility dep * fix: π compile err * fix: π typos * chore: π€ remove temp snapshot * chore: π€ clean up * chore: π€ lint * chore: π€ add concatenateModules option * chore: π€ update config * chore: π€ fix test * fix: π fix js test * fix: π js test case * fix: π finish todo!
- Loading branch information
1 parent
800542b
commit 5cb3d9b
Showing
72 changed files
with
4,841 additions
and
164 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 answer = 103330 |
14 changes: 14 additions & 0 deletions
14
crates/rspack/tests/samples/concatenate-modules-demo/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,14 @@ | ||
import { answer as some } from "./lib"; | ||
some | ||
|
||
function answer() { | ||
|
||
} | ||
|
||
answer() | ||
|
||
function test() { | ||
|
||
} | ||
|
||
|
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 {answer} from './answer.js' |
25 changes: 25 additions & 0 deletions
25
crates/rspack/tests/samples/concatenate-modules-demo/snapshot/output.snap
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,25 @@ | ||
--- | ||
source: crates/rspack_testing/src/run_fixture.rs | ||
--- | ||
```js title=main.js | ||
(self['webpackChunkwebpack'] = self['webpackChunkwebpack'] || []).push([["main"], { | ||
"./index.js": (function () { | ||
;// CONCATENATED MODULE: ./answer.js | ||
const answer = 103330; | ||
;// CONCATENATED MODULE: ./index.js | ||
answer; | ||
function indexjs_answerindexjs_answer_0() {} | ||
indexjs_answerindexjs_answer_0(); | ||
function test() {} | ||
}), | ||
},function(__webpack_require__) { | ||
var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId) } | ||
var __webpack_exports__ = (__webpack_exec__("./index.js")); | ||
} | ||
]); | ||
``` |
11 changes: 11 additions & 0 deletions
11
crates/rspack/tests/samples/concatenate-modules-demo/test.config.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,11 @@ | ||
{ | ||
"optimization": { | ||
"concatenateModules": true, | ||
"sideEffects": "true" | ||
}, | ||
"builtins": { | ||
"define": { | ||
"process.env.NODE_ENV": "'development'" | ||
} | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.
5cb3d9b
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