Commit Graph

79 Commits

Author SHA1 Message Date
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