Commit Graph

309 Commits

Author SHA1 Message Date
Tobias Koppers 9cb1a66317 add support for link preload/prefetch
`import(/* webpackPrefetchPriority: 10 */ "...")`
`import(/* webpackPreloadPriority: 10 */ "...")`
2018-04-16 11:29:25 +02:00
Mohsen Azimi 589f40b26a Add missing class member initializations found by TypeScript 2018-04-11 16:48:44 +02:00
Florent Cailhol fe73712e5b Remove unecessary _this binding 2018-04-10 23:04:20 +02:00
Tobias Koppers 8de560552c sort child compilations for consitent hash
fixes webpack-contrib/mini-css-extract-plugin#75
2018-04-03 17:36:12 +02:00
Tobias Koppers 8d8da4cdff Merge branch 'master' into bump_prettier 2018-03-29 11:48:02 +02:00
Tobias Koppers d4f3c775d5
Merge pull request #6883 from mohsen1/remove-dead-code
Initialize fileTimestamps and contextTimestamps in Compilation
2018-03-29 10:52:06 +02:00
Tobias Koppers 4b6ee7356d
Merge pull request #6894 from webpack/bugfix/css-stuff
fixes for mini-css-extract-plugin
2018-03-29 10:50:38 +02:00
Mohsen Azimi 7a72ee92c0
Merge branch 'master' of github.com:webpack/webpack into remove-dead-code
# Conflicts:
#	lib/Compilation.js
2018-03-28 21:25:46 -07:00
Mohsen Azimi 77535dde7c
Initialize fileTimestamps and contextTimestamps in Compilation 2018-03-28 10:10:28 -07:00
Mohsen Azimi 9728f2d2e0
Revert "Remove dead code in Compilation.js"
This reverts commit 847bfa4c63.
2018-03-28 10:08:25 -07:00
Mohsen Azimi bc76fee70b
Initialize compilationDependencies in Compilation as undefined 2018-03-28 10:05:29 -07:00
Tobias Koppers 93a5bf567f fixes for mini-css-extract-plugin 2018-03-28 16:19:15 +02:00
Mohsen Azimi d2dbed5dda
Update Compilation.js 2018-03-27 22:41:45 -07:00
Mohsen Azimi 864a15977f
Remove extra arguments passed to SortableSet initializing fileDependencies 2018-03-27 22:36:45 -07:00
Mohsen Azimi 847bfa4c63
Remove dead code in Compilation.js 2018-03-27 22:23:47 -07:00
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Tobias Koppers 296542ed79 add [contenthash] support 2018-03-24 12:08:36 +01:00
Florent Cailhol 3983803d30 Destructure 'require' to improve readability 2018-03-22 12:05:58 +01:00
Josh Soref 96ebb27964 spelling: connect 2018-02-26 02:27:17 +00:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Tobias Koppers e52f323750 optimize performance of assignDepth 2018-02-24 14:38:16 +01:00
Suguru Motegi 864e563173 replace Async with Neo-Async 2018-02-11 14:31:08 -08:00
Tobias Koppers d6816afddf
Merge pull request #6355 from webpack/for_of_loops
Use for-of loops instead of forEach
2018-01-24 10:35:58 +01:00
Tobias Koppers 7a1b357aad
Merge branch 'next' into for_of_loops 2018-01-24 09:01:31 +01:00
Tobias Koppers ad75e44d02
Merge branch 'next' into remove_v3_deprecated 2018-01-24 08:45:13 +01:00
Florent Cailhol 7b8fa112e0 Remove v3 deprecated APIs 2018-01-23 23:25:01 +01:00
Florent Cailhol d4811b0d37 Use for-of loops instead of forEach 2018-01-23 22:53:18 +01:00
Florent Cailhol 77bb4c0055 Deprecate forEach* and map* methods 2018-01-23 22:19:59 +01:00
Florent Cailhol 6192e5b413 Use hooks instead of applyPlugins 2018-01-22 15:23:52 +01:00
Tobias Koppers 18ae73dad4 Refactor chunk graph
Chunks are now always in ChunkGroups
ChunkGroups have parents and children, Chunks no longer have this
AsyncDependenciesBlocks point to a ChunkGroup instead of a list of chunks
Entrypoint is now a ChunkGroup (extends from it)
move stuff graph modification methods into GraphHelpers
Change chunk id recording to source-based
Chunks have parents, siblings and children in Stats
rename AutomaticCommonsChunksPlugin to SplitChunksPlugin
add request property to origin (ChunkGroup)
remove moveToParent from AggressiveMergingPlugin
fix issues with AggressiveSplittingPlugin
remove CommonsChunkPlugin
add optimization.runtimeChunk (RuntimeChunkPlugin)
fix a filename bug for initial chunks
remove extract-text-webpack-plugin from test suite
add DebugHash to help debugging hash issues
fix issues with entry modules in different chunk as runtime
redo optimization.splitChunks options
Compilation.entrypoints is now a Map
Compilation.chunkGroups has been added
remove some unittests
update examples
update tests with CommonsChunkPlugin
2018-01-19 19:21:30 +01:00
Florent Cailhol 1590751da2 Replace dictionaries by Map or Set 2018-01-06 09:45:57 +01:00
Tobias Koppers 1886b7a5cb Merge branch 'master' into next
# Conflicts:
#	bin/webpack.js
#	lib/Compilation.js
#	yarn.lock
2017-12-29 11:17:10 +01:00
Maximilien Garenne c4fa27b451 fix lint errors 2017-12-28 14:38:03 +01:00
Maximilien Garenne 71d12979e4
Refresh code of Compilation.js
I replaced some let by const, removed some unecessary this bindings, rewrote the part with self by this with paying attention to keep the binding to this.
2017-12-28 11:39:29 +01:00
Sean Larkin 30ac70083d
Merge pull request #6101 from webpack/feature/tapable-upgrade-json-export-main-template-plugin
feat(tapable): upgrade other template plugins
2017-12-22 21:38:05 -08:00
Tobias Koppers 2a1546d355 fix reversed order in OccurenceOrderPlugin
try to keep original order
fallback order by name if index order fails
2017-12-20 20:35:16 +01:00
EugeneHlushko 370eb38e32 Feature: Disallow to load initial chunk on demand..: rename class to Error 2017-12-19 17:41:56 +02:00
EugeneHlushko 3096317a4b Feature: Disallow to load initial chunk on demand via throwing an error 2017-12-19 17:12:48 +02:00
Sean Larkin fb5351ec25
Merge branch 'next' into feature/tapable-upgrade-json-export-main-template-plugin 2017-12-15 23:48:48 -08:00
Sean Larkin 5eee030cae fix(tapable): refactored calls to iterator and add some destructuring 2017-12-15 16:14:19 -08:00
Tobias Koppers 90c5adef14 linting, unittests 2017-12-12 21:21:02 +01:00
Tobias Koppers c68f224272 move providedExports into buildMeta 2017-12-12 17:01:03 +01:00
Tobias Koppers ffb977fed4 refactor meta -> buildMeta, add factoryMeta
add compat layer to Module.meta
2017-12-12 16:57:50 +01:00
Tobias Koppers 2bb95a3b93 Refactor addModule to keep Module instances between rebuilds 2017-12-12 16:57:50 +01:00
Tobias Koppers 758a388f69 pass runtimeTemplate to DependencyTemplate
move outputOptions and requestShortener into runtimeTemplate
2017-12-11 17:59:32 +01:00
Sean Larkin 25c135aa82 feat(tapable): upgrade other template plugins 2017-12-08 02:05:45 -08:00
Tobias Koppers 7d87f34269 Only create one RequestShortener per Compiler
move Compiler.context assignment into Compiler
2017-12-04 12:23:42 +01:00
Tobias Koppers 0d66130daf always create a CachedSource, because it's accessed multiple times 2017-12-04 12:23:32 +01:00
Tobias Koppers 88ad7ed186 Merge branch 'refactoring/plugin-system-templates' into refactoring/plugin-system-all 2017-11-29 08:07:18 +01:00
Tobias Koppers 56328a7cab upgrate tapable in Templates 2017-11-28 18:43:01 +01:00
Tobias Koppers 7787b4ad13 upgrade tapable for Compilation 2017-11-27 21:14:16 +01:00
Tobias Koppers 5a4f0aca67 change imports of tapable to old version
prepare to migrate to new tapable version
2017-11-27 20:56:42 +01:00
Tobias Koppers a0ef93f939 aggregate all crypto hash usages into util/createHash
try to avoid calling hash.update with short strings
2017-11-23 11:09:17 +01:00
Tobias Koppers 5a8e7673cb fix weak status of harmony accept dependency
add test case for accepting default import
2017-11-22 08:06:47 +01:00
Tobias Koppers 4c4121b948 fix test and lint issues 2017-11-19 09:06:40 +01:00
Tobias Koppers 93171b9795 replace isEqualResource with more performance implementation 2017-11-19 00:22:38 +01:00
Tobias Koppers 5e39ec46ee Allow to override resolve configuration 2017-11-18 08:12:35 +01:00
Tobias Koppers a53672d1a2 Merge branch 'master' into next
# Conflicts:
#	lib/EvalSourceMapDevToolModuleTemplatePlugin.js
#	lib/dependencies/HarmonyDetectionParserPlugin.js
#	lib/dependencies/HarmonyImportDependency.js
#	package.json
#	schemas/webpackOptionsSchema.json
#	test/Validation.test.js
2017-11-17 16:03:46 +01:00
Tushar Sharma ee84d788dd vars to lets and const 2017-11-15 13:58:45 +05:30
Tobias Koppers 65e855c636 fix deprecations 2017-11-11 11:27:02 +01:00
Tobias Koppers 9b9b6eafe0 add deprecation message to Compilation.moduleTemplate 2017-11-10 11:36:49 +01:00
Tobias Koppers 41a1d602e1 added WebAssembly Proof of Concept 2017-11-10 09:17:11 +01:00
Tobias Koppers 860da9baaa
Merge branch 'next' into refactor/sets 2017-11-08 21:28:51 +01:00
Tobias Koppers 75f68a2635 fixes linting, remove not needed context arguments 2017-11-08 20:49:41 +01:00
Tobias Koppers f7c2f8e470 Update code style to arrow functions 2017-11-08 11:56:01 +01:00
Tobias Koppers 447d85ad79 Merge branch 'next' into refactor/sets
# Conflicts:
#	lib/ContextModule.js
#	lib/NormalModule.js
#	lib/optimize/ConcatenatedModule.js
2017-11-08 06:01:24 +01:00
Tobias Koppers 51c572c4f5 refactor more properties to Sets 2017-11-07 09:17:12 +01:00
Tobias Koppers 0339d4da49 Refactor weird things
* Declare used properties in constructor
* Module.(re)building moved into Compilation._(re)buildingModules (Map)
* Make NormalModule.error private
* Move Module.cacheable logic into needRebuild
* More stable implemention of rebuildModule
* addModuleChain waits for Module building finished before returning
* Set built and cacheable flags correctly in Modules
* More portableId into WeakMap
* Add ModuleReason for entrypoints
* cacheable can be true/false/null in Stats
* added Stats module issuerPath
* fixes profile in stats output
2017-11-06 13:16:09 +01:00
Tobias Koppers 82f42e2c67 Merge branch 'master' into next 2017-10-17 12:38:38 +02:00
Tobias Koppers b597322e3c fix behavior and add a warning when trying to load an
initial chunk on demand
2017-10-17 09:06:05 +02:00
Tobias Koppers 814c894168 Merge branch 'master' into next
# Conflicts:
#	lib/optimize/CommonsChunkPlugin.js
#	test/statsCases/limit-chunk-count-plugin/expected.txt
#	test/statsCases/named-chunks-plugin-async/expected.txt
#	test/statsCases/optimize-chunks/expected.txt
2017-10-16 10:47:17 +02:00
Tobias Koppers 11e28793fa improve performance by doing a breath-first traversal in the chunk graph
This is faster because shorter paths usually have less modules available.
This allows to reach minimal modules faster
2017-10-12 20:03:36 +02:00
Tobias Koppers 5abd69680d Merge branch 'master' into next
# Conflicts:
#	lib/Compilation.js
#	test/statsCases/optimize-chunks/expected.txt
2017-10-11 19:26:00 +02:00
Tobias Koppers 7ebf9314d6 Merge pull request #5786 from webpack/performance/chunks
improve chunk graph building performance
2017-10-11 17:05:20 +02:00
Tobias Koppers 2919a9cd53 prevent crashing when error out early in bail mode
fixes #5787
2017-10-11 15:28:18 +02:00
Tobias Koppers 7870bfc01d improve chunk graph building performance
document algorithm
2017-10-11 15:08:00 +02:00
Tobias Koppers 03b0ff2c9c Merge branch 'master' into next 2017-10-11 12:42:31 +02:00
Tobias Koppers 91df794788 bugfix and test for graph correctness 2017-10-11 11:13:36 +02:00
Tobias Koppers 130ace8ba7 fix graph correctness with multiple entries 2017-10-11 10:01:00 +02:00
Tobias Koppers 07992cf588 fix sorting issue 2017-09-22 17:23:49 +02:00
Tobias Koppers 7ceac63f07 add support for pure modules 2017-09-14 09:44:42 +02:00
Tobias Koppers e5f4eb147a Merge branch 'master' into refactor/cleanups 2017-08-12 10:03:51 +02:00
Tobias Koppers 839915ccf7 Merge pull request #5501 from webpack/bugfix/hash-watch-warnings-errors
Warnings and Errors contribute to hash
2017-08-11 17:46:49 +02:00
Tobias Koppers 38201575ea fix lint problem 2017-08-11 16:58:18 +02:00
Tobias Koppers 09c34cf280 remove hash from stats test with error
because error contains an absolute path
2017-08-11 16:28:40 +02:00
Tobias Koppers f9bf8a9085 Limit the number of parallel processed modules
fixes #3164
fixes #3166
2017-08-11 16:11:17 +02:00
Tobias Koppers 7905bf57f0 Warnings and Errors contribute to hash 2017-08-11 14:35:08 +02:00
Adam Thomann 70f5698145 Add semicolon 2017-08-11 00:05:25 -04:00
Adam Thomann 12f20935bc Convert errorAndCallback ternary to arrow function 2017-08-10 23:58:49 -04:00
Tobias Koppers 4c81b9a017 move weak into getReference 2017-08-08 09:43:33 +02:00
Tobias Koppers c1a02446ac store hash in depndencyTemplates Map instead of comparing identify
This restores original performance on incremental builds

fixes #5289
fixes #5277
2017-07-14 13:03:30 +02:00
Tim Sebastian 5b4836d185 remove "lastId" as there is no usecase 2017-06-21 22:22:00 +10:00
Tobias Koppers 5d4ba56c5f Allow scope hoisting to process modules in multiple chunks 2017-06-14 22:46:26 +02:00
Tobias Koppers cc705ec609 avoid creating recursive chunk references
parent-child-dependencies are more optimized
2017-06-09 16:06:52 +02:00
Tobias Koppers 4a25a17bb6 improvements from review 2017-05-21 09:15:42 +02:00
Tobias Koppers 9b2a9fa786 Scope Hoisting 2017-05-21 09:15:41 +02:00
Tobias Koppers 2bd2d2844c improve a few issues
from review by @Kovensky
2017-05-20 14:54:42 +02:00
Tobias Koppers 8d3efe7d63 Merge branch 'next' into perf/modules-set 2017-05-16 14:37:03 +02:00
Tobias Koppers 101850c5a9 assign correct records and cache to child compilations
This is a breaking change because plugins or loader could rely on this incorrect behavior
When using child compilations plugins and loaders should use a unique compiler name or use a consistent order

fixes #2777
2017-05-04 13:05:03 +02:00
J Huang 94d0641ba4 perf: use Date.now() instead of +new Date()
+new Date() is 2x slower than Date.now(), see https://jsperf.com/new-date-vs-date-now-vs-performance-now/6
2017-05-04 10:19:10 +08:00