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

Get rid of immutable.js and implement tree-shaking for broken control flow #3153

Merged
merged 35 commits into from Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ba14bd7
Switch to a mutable context
lukastaegert Sep 2, 2019
4baa7bc
Turn the unknown key into a Symbol
lukastaegert Sep 2, 2019
167f99e
Get rid of immutable and create a new path tracker
lukastaegert Sep 6, 2019
fa7a030
Replace mutable entity tracker with the new simple path tracker
lukastaegert Sep 6, 2019
844c8ec
Refactor context to align ignore properties
lukastaegert Sep 6, 2019
91603b2
Move function ignore reset to actual functions
lukastaegert Sep 6, 2019
190074c
Prevent recursions on call expression level
lukastaegert Sep 6, 2019
3d4a331
Add infinite recursion protection again
lukastaegert Sep 6, 2019
30016d4
Fix perf script
lukastaegert Sep 6, 2019
5a2da60
Use a Symbol for unknown values as well
lukastaegert Sep 7, 2019
3f05ab7
Fix tests after merge
lukastaegert Oct 4, 2019
b9a080c
Add separate context for inclusion
lukastaegert Oct 5, 2019
6cceafe
Handle broken control flow due to errors
lukastaegert Oct 6, 2019
17be1a4
Make if-statement logic more clear
lukastaegert Oct 6, 2019
63e0735
Simplify BreakFlow type
lukastaegert Oct 6, 2019
2cc9e6a
Restore broken flow after conditional statements
lukastaegert Oct 7, 2019
dc3a706
Also break on return statements
lukastaegert Oct 7, 2019
8abdb90
Implement basic break support
lukastaegert Oct 7, 2019
bdbc7fd
Implement continue statements and basic support
lukastaegert Oct 7, 2019
df74d6b
Add basic label support
lukastaegert Oct 7, 2019
2aa22d8
Refine label support
lukastaegert Oct 8, 2019
d888d4f
Improve switch-statement handling
lukastaegert Oct 9, 2019
4a207ce
Ignore side-effects after broken control flow, treat hoisted function…
lukastaegert Oct 10, 2019
da66c10
Make sure labeled statements do not swallow other break statements
lukastaegert Oct 11, 2019
b13b423
Refactor switch statement slightly
lukastaegert Oct 11, 2019
bba01fd
Update dependencies and fix tests
lukastaegert Oct 11, 2019
18cdfea
Make the context the first include argument
lukastaegert Oct 13, 2019
c1364c7
Reuse inclusion context when including functions
lukastaegert Oct 13, 2019
7190eaf
Reuse inclusion context when including call arguments
lukastaegert Oct 13, 2019
145dfd7
Reuse inclusion context when including local variables
lukastaegert Oct 13, 2019
c7969ca
Improve coverage for catch scopes
lukastaegert Oct 13, 2019
96c6fdc
Improve coverage, check access side-effects for instantiation, respec…
lukastaegert Oct 14, 2019
caaa3d4
Fix old Node syntax error
lukastaegert Oct 14, 2019
59b8673
Improve coverage
lukastaegert Oct 14, 2019
8949aaa
Improve coverage
lukastaegert Oct 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 1 addition & 30 deletions LICENSE.md
Expand Up @@ -154,35 +154,6 @@ Repository: git@github.com:indutny/hash.js

---------------------------------------

## immutable
License: MIT
By: Lee Byron
Repository: git://github.com/facebook/immutable-js.git

> MIT License
>
> Copyright (c) 2014-present, Facebook, Inc.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

---------------------------------------

## inherits
License: ISC
Repository: git://github.com/isaacs/inherits
Expand Down Expand Up @@ -398,7 +369,7 @@ Repository: git://github.com/kamicane/require-relative.git
## rollup-pluginutils
License: MIT
By: Rich Harris
Repository: git+https://github.com/rollup/rollup-pluginutils.git
Repository: rollup/rollup-pluginutils

---------------------------------------

Expand Down
156 changes: 98 additions & 58 deletions package-lock.json

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

13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -86,13 +86,12 @@
"es6-shim": "^0.35.5",
"eslint": "^6.5.1",
"eslint-plugin-import": "^2.18.2",
"execa": "^2.0.5",
"execa": "^2.1.0",
"fixturify": "^1.2.0",
"hash.js": "^1.1.7",
"husky": "^3.0.8",
"immutable": "^4.0.0-rc.12",
"is-reference": "^1.1.4",
"lint-staged": "^9.4.1",
"lint-staged": "^9.4.2",
"locate-character": "^2.0.5",
"magic-string": "^0.25.4",
"markdownlint-cli": "^0.18.0",
Expand All @@ -105,7 +104,7 @@
"pretty-ms": "^5.0.0",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
"rollup": "^1.23.0",
"rollup": "^1.23.1",
"rollup-plugin-alias": "^2.0.1",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
Expand All @@ -123,12 +122,12 @@
"source-map": "^0.6.1",
"source-map-support": "^0.5.13",
"sourcemap-codec": "^1.4.6",
"systemjs": "^6.1.2",
"terser": "^4.3.6",
"systemjs": "^6.1.3",
"terser": "^4.3.8",
"tslib": "^1.10.0",
"tslint": "^5.20.0",
"turbocolor": "^2.6.1",
"typescript": "^3.6.3",
"typescript": "^3.6.4",
"url-parse": "^1.4.7"
},
"files": [
Expand Down
9 changes: 6 additions & 3 deletions scripts/load-perf-config.js
Expand Up @@ -8,7 +8,9 @@ const configFile = path.resolve(exports.targetDir, 'rollup.config.js');
try {
fs.accessSync(configFile, fs.constants.R_OK);
} catch (e) {
console.error(`No valid "rollup.config.js" in ${exports.targetDir}. Did you "npm run perf:init"?`);
console.error(
`No valid "rollup.config.js" in ${exports.targetDir}. Did you "npm run perf:init"?`
);
process.exit(1);
}

Expand All @@ -18,8 +20,9 @@ exports.loadPerfConfig = async () => {
external: id => (id[0] !== '.' && !path.isAbsolute(id)) || id.slice(-5, id.length) === '.json',
onwarn: warning => console.error(warning.message)
});
const configs = loadConfigFromCode((await bundle.generate({ format: 'cjs' })).code);
return Array.isArray(configs) ? configs[0] : configs;
let config = loadConfigFromCode((await bundle.generate({ format: 'cjs' })).output[0].code);
config = typeof config === 'function' ? config({}) : config;
return Array.isArray(config) ? config[0] : config;
};

function loadConfigFromCode(code) {
Expand Down