Commit Graph

240 Commits

Author SHA1 Message Date
Josh Soref 581069bb56 spelling: uncaught 2018-02-26 02:50:05 +00:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Florent Cailhol 63b4523a15 Pass 'context' as constructor argument 2018-01-30 21:40:44 +01: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 9c8098c635
Merge pull request #6370 from webpack/remove_v3_deprecated
Remove v3 deprecated APIs
2018-01-24 09:43:10 +01:00
Tobias Koppers 7a1b357aad
Merge branch 'next' into for_of_loops 2018-01-24 09:01:31 +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
Evan Scott 1f29fa9b51 perf: refactor various timestamp caches into ES6 Maps
This change satisfies https://github.com/webpack/webpack/issues/6234
which desires to change the timestamp caches from plain objects to
the ES6 Map type to avoid deopts, since v8 expects things to be
added to Maps but objects are only fast if properties aren't added
dynamically after initial assignment.
2018-01-23 02:30:22 -05: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
Vitali Kuzmich 3a89252c62 Avoid extra semicolons in bundled files. Don't recreate the function on an each iteration. 2018-01-06 05:18:40 +03:00
Tobias Koppers ed811a5aa8 remove repeated code 2017-12-22 19:42:44 +01:00
Tobias Koppers 53a1d6c7b5 replace harmonyModule flag with exportsType 3-state
exportsType falsy: It's non-harmony module
exportsType "namespace": It's a harmony module, the exports is the namespace object
exportsType "default": It's a harmony module, the exports is the default exports, named exports are properties of the default export
2017-12-22 19:42:41 +01:00
Tobias Koppers 2aac6badd5 move generated runtime code to RuntimeTemplate 2017-12-22 19:41:28 +01:00
Tobias Koppers e829a5ed71 Reset dependencies in unbuild
Elsewise they are cleared in disconnect and module removing doesn't work correctly
2017-12-12 17:01:14 +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 758a388f69 pass runtimeTemplate to DependencyTemplate
move outputOptions and requestShortener into runtimeTemplate
2017-12-11 17:59:32 +01:00
Tobias Koppers 515a07adbf fix non-harmony import() handling for `null` 2017-12-04 15:49:34 +01:00
Tobias Koppers 3803c8ad4e handle non-esm correctly in import()
return namespace object in normal import() and context import()
add namespaceObject flag to ContextModule options
change tests for updated behavior
2017-12-04 12:58:32 +01:00
Tobias Koppers b608ee7f7b add resourceQuery to ContextModule identifier 2017-12-04 12:04:35 +01:00
Tobias Koppers 5e39ec46ee Allow to override resolve configuration 2017-11-18 08:12:35 +01:00
Tobias Koppers 33c7970c0d
Merge pull request #5732 from anuraaga/context-query
Support resourceQuery in context dependencies.
2017-11-16 14:16:19 +01:00
Anuraag Agrawal ce266cb6f6 Support resourceQuery in context dependencies. 2017-11-16 15:20:50 +09: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 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 ea56916d53 rename `async` to `mode` in context options
`async: false` is now `mode: "sync"`
2017-10-16 14:49:51 +02:00
Tobias Koppers 47d00a525f use util.deprecate to deprecate properties in ContextModule 2017-10-16 12:16:07 +02:00
Tobias Koppers aa8d076407 fix comment 2017-10-16 09:36:59 +02:00
Landon Crapo 0a141f21c8 fixed failing tests 2017-10-13 17:51:01 -06:00
Landon Crapo bc6c1be90c refactoring filter to include and other requested changes 2017-10-13 15:41:44 -06:00
Landon Crapo 5d1759fd4c modified import context filtering logic to filter on file names. 2017-10-13 15:41:02 -06:00
Tobias Koppers 72544de846 code cleanup 2017-07-26 15:13:39 +02:00
Tobias Koppers 94e0fcb80a rename eager-weak to weak in import() comment
rename ImportEagerWeak to ImportWeak
rename "eager-weak" asyncMode to "async-weak"

weak dependencies don't need to be in dependencies blocks
2017-07-26 14:49:37 +02:00
James Gillmore 8bca2dc95c fix/feat($weak): add context support for resolveWeak + create eager-weak asyncMode 2017-07-26 13:12:59 +02:00
James Gillmore 1102e60395 fix($lint): fix linting errors 2017-07-26 13:12:59 +02:00
James Gillmore 4636e5a705 feat($weakContext): create "weak-context" asyncMode for universal rendering 2017-07-26 13:12:59 +02:00
Tobias Koppers 22e7d254ee Add webpackMode optios for import()
Allow lazy, lazy-once and eager mode for import()
Fix a bug which caused context chunks to be merged when using chunk name
Allow to work in env where there is no Promise.resolve
2017-05-05 09:03:24 +02:00
J Huang 6afc397b99 perf: use Date.now() instead of new Date().getTime()
new Date().getTime() is 2x slower than Date.now(), see https://jsperf.com/new-date-vs-date-now-vs-performance-now/6
2017-05-04 10:19:54 +08:00
mc-zone b65432a2f1 Add specify chunk name feature for `import()`
Add specify chunk name feature for `import()` by following special comment block after the param:

  import('./foo' /* webpackChunkName = "myChunkName" */)

Thus we can use chunk name like `requre.ensure` and avoid conflicts with the specification.
2017-03-26 17:18:30 +08:00
Tobias Koppers b732e1b25b rename count to size 2017-02-28 12:07:27 +01:00
Tim Sebastian 1e906f1468 apply review changes 2017-02-23 21:52:11 +11:00
Tim Sebastian c29f324f07 set dependencies to empty array if they dont exist
no need to check them in size calculation for existance anymore
2017-02-19 11:00:06 +11:00
Tim Sebastian d424633467 rename hasMultipleChunks to hasMultipleOrNoChunks 2017-02-18 23:01:29 +11:00
Tim Sebastian 833c0330fd refactor source method of contextmodule 2017-02-18 22:41:39 +11:00
Tim Sebastian f77775d0f6 refactor `size` 2017-02-18 21:13:39 +11:00
Tim Sebastian a61ec92a0a simplify build by early returning if no dependencies exist 2017-02-18 21:09:18 +11:00
Tim Sebastian 4d6fafe1b5 simplify identifiers 2017-02-18 20:29:21 +11:00
Tim Sebastian a3f0da5b89 describe prettyRegExp and give param an better name 2017-02-18 20:26:47 +11:00
Tim Sebastian 084d11231b cleanup contextify usage by passing context directly as parameter 2017-02-18 20:15:29 +11:00
Tim Sebastian 4cd13ca651 refactor ContextModule to esnext 2017-02-18 20:14:43 +11:00
Tobias Koppers 8e69a80847 code linting 2017-01-11 12:29:01 +01:00
Tobias Koppers da29d21ae4 performance improvements
breaking change: Module has now a "unbuild" method that must work correctly
2016-12-14 16:22:16 +01:00
Tobias Koppers 4414de18ba support lib ids for context modules 2016-12-14 12:03:56 +01:00
Matthew Pietz 6c6eb3ae98 Escape webpackContext.id value 2016-12-08 12:14:51 -08:00
Noah Fontes ab9aef1140 Fix issue with async dynamic System.import dependencies not being re-emitted 2016-06-28 10:42:35 -07:00
Tobias Koppers c46e3e82c0 fixed System.import context
fixed #2490
2016-06-05 09:15:17 +02:00
e-cloud 13322ca35c add missing constructors for all classes needed
As i walk through the source, i've tried to trace the webpack running stack.
Then, i find the missing constructors result in uncleasr stack and create a patch
for them.
2016-05-20 13:39:36 +08:00
Tobias Koppers 93f38132d1 fixed #2443 2016-05-14 14:41:31 +02:00
Tobias Koppers ce642eced6 reverted module.e to module.exports
because it causes issues with modules that define
exports on the module object
2016-04-21 23:50:40 +02:00
Tobias Koppers 902220a0ea smaller bundles by using module.e instead of module.exports
same for module.loaded and module.id
2016-02-13 13:11:34 +01:00
Tobias Koppers a4cc54e759 added manual context map option to ContextReplacementPlugin 2016-01-06 19:56:17 +01:00
Tobias Koppers ded70aef28 moves stuff from webpack-core to webpack-sources 2015-12-29 17:44:55 +01:00
Tobias Koppers 4c69156172 fixed #1769 2015-12-22 11:00:48 +01:00
Tobias Koppers f3197f5313 typo 2015-09-03 11:36:02 +02:00
Tobias Koppers 431a4c791c Merge branch 'master' into webpack-2
Conflicts:
	hot/dev-server.js
	hot/only-dev-server.js
	hot/poll.js
	hot/signal.js
	lib/ChunkTemplate.js
	lib/HotModuleReplacement.runtime.js
	lib/HotModuleReplacementPlugin.js
	lib/JsonpMainTemplatePlugin.js
	lib/MainTemplate.js
	lib/NormalModule.js
	lib/Parser.js
	lib/RecordIdsPlugin.js
	lib/WebpackOptionsApply.js
	lib/dependencies/RequireEnsureDependency.js
	lib/node/OldNodeWatchFileSystem.js
	lib/optimize/OccurrenceOrderPlugin.js
	package.json
2015-07-17 09:30:37 +02:00
Tobias Koppers f7d799adb4 rebeautify without spacing after keyword 2015-07-16 00:19:23 +02:00
Avi Haiat 0a340f2b1a feat(app): Beautify all lib files 2015-07-13 01:20:09 +03:00
Tobias Koppers d98df52a49 added System.import API and async context 2015-07-01 00:19:52 +02:00
Tobias Koppers 2245c4acca Promise based chunk loading API
don't flag entry module with `0` id anymore
use extra argument in chunk instead
this allows to require entry points
2015-06-13 11:45:28 +02:00
Tobias Koppers d3a7994e35 expose `loc` for every Dependency 2015-05-10 18:31:58 +02:00
Tobias Koppers cebd3b9722 added linting 2015-04-23 23:55:50 +02:00
Tobias Koppers c0686c4430 support an empty context
fixed #524
2014-10-12 11:24:42 +02:00
Tobias Koppers 63e2dd3804 better gzip for context 2014-09-26 08:52:47 +02:00
Mark Marijnissen 8fbfbc9e34 Update ContextModule.js
added semicolon
2014-09-15 17:59:49 +02:00
Mark Marijnissen aa39f79baf Add 'id' attribute to require.context (so HMR can accept a context) 2014-09-14 01:50:59 +02:00
Tobias Koppers 61bc53e875 Shorter and faster empty context
#198
2014-07-26 14:48:42 +02:00
Tobias Koppers d80cdcefac Code Quality 2014-06-24 18:53:32 +02:00
Tobias Koppers 0fea43b4cb rename generated require to __webpack_require__
fixes #141
fixes RubenVerborgh/N3.js#18
2014-03-03 14:56:17 +01:00
Tobias Koppers 074a26efb5 Performance #106 2013-10-14 13:59:44 +02:00
Tobias Koppers 0de7c73ad8 SourceMap support 2013-03-26 16:54:41 +01:00
Tobias Koppers f3213f2d00 create context for more stuff 2013-02-20 20:40:40 +01:00
Tobias Koppers 90f8a42ab3 fixed some examples stuff 2013-02-13 11:51:08 +01:00
Tobias Koppers 453c0226aa Fix context modules 2013-02-04 12:34:20 +01:00
Tobias Koppers e8f0e1d7cf fix watching 2013-02-01 08:03:38 +01:00
Tobias Koppers 961ad40966 file watching 2013-01-31 18:00:22 +01:00
Tobias Koppers ee01837d66 Refactored everything for 0.9 2013-01-30 18:49:25 +01:00