Commit Graph

324 Commits

Author SHA1 Message Date
Olivier Combe 2aebfbe48c fix(ConcatenatedModule): don't throw on arrays with empty values
Fixes #6407
Fixes #5415
Ref https://github.com/angular/angular/issues/21809
2018-01-29 15:52:01 +01:00
Joe Lencioni 37d70bd0c6 Avoid calling hash.update multiple times in ConcatenatedModules
@sokra did some profiling and it seems that calling crypto.update
multiple times is slower than calling it once with a large string.

> As explanation I would guess update calls into node.js C++ + OpenSSL
> while concatenating strings is very optimized in JIT.

To take better advantage of this information, I have rewritten this
performance-sensitive code to build up a concatenated string and then
hash it at the end.

Since we are thinking about performance here, I opted for a regular for
loop instead of using the forEach iterator. I also did some basic
benchmarking of string concatenation strategies and discovered that
separating out the addition of the extra space into its own
concatenation line instead of tacking it on to the end of a single
concatenation might just barely have the edge in terms of performance. I
think it is also very readable this way, so it seems like a good
tradeoff to make: a little lost conciseness for speed.
2017-11-23 08:31:16 -08:00
Joe Lencioni 8fdf411b84 Simplify identifier creation in ConcatenatedModules
This was implemented in #5997 to fix some memory issues, but I think we
can make this a little more efficient. By using a single forEach instead
of a map, filter, and join, we avoid unnecessary array creations and
iterations.
2017-11-23 07:47:18 -08:00
Filipe Silva aef6f19a60 Use shorter identifier for ConcatenatedModules
See https://github.com/webpack/webpack/issues/5992#issuecomment-346384896 for rationale.

Fixes #5992
2017-11-22 16:33:36 +00:00
Tobias Koppers 4960c5ba4e cleanup CommonsChunkPlugins changes 2017-10-13 10:36:08 +02:00
Tobias Koppers 1381f6745b fix crashes when imported module fails compiling 2017-10-11 17:22:11 +02:00
Tobias Koppers d9accb450c Merge pull request #5764 from ljcrapo/commons-chunk-deep-children
Added deepChildren support from ArcEglos' pull request
2017-10-11 12:34:40 +02:00
Landon Crapo 87bff6cd98 fixed common-chunk-grandchildren example
* using set instead of array
 * example of async use case
2017-10-09 10:29:38 -06:00
Tobias Koppers 9357ae0254 Refactor precendence rules for harmony exports for better performance
fixes #5763
2017-10-09 15:28:59 +02:00
Landon Crapo 4f9fc01be4 Added deepChildren support from ArcEglos' pull request and fixed failing tests 2017-10-05 15:31:29 -06:00
Tobias Koppers af470a504e handle inner non-harmony dependencies correctly in ConcatenatedModule
add async as keyword

fixes #5604
fixes #5615
2017-09-04 14:09:55 +02:00
Tobias Koppers 6bdd9dca87 Merge pull request #5535 from webpack/bugfix/incremental-concat-compat
set compatiblity flag correctly even after incremental build
2017-08-16 15:21:04 +02:00
Tobias Koppers c5deb595c5 set compatiblity flag correctly even after incremental build
fixes #5510
2017-08-16 14:59:09 +02:00
Tobias Koppers 99c2706ed3 Ensure that graph structure stay consistent
fixes #5527
2017-08-16 14:05:06 +02:00
Tobias Koppers 0ea37a5485 Disallow Scope Hoisting when using HMR
fixes #5504
2017-08-12 11:00:55 +02:00
kisenka 3d272aceea fix: restore `modules` property of ConcatenatedModule (fixes #5477) 2017-08-12 01:01:50 +03:00
kisenka 7a36951aa8 Merge branch 'master' of https://github.com/webpack/webpack into concatenated-module-in-3.5-compat 2017-08-12 00:58:43 +03:00
Tobias Koppers 0e73a2458a also generate a new identifier for interop name
fixes #5481
2017-08-10 12:14:31 +02:00
kisenka 438fd14ae5 fix: restore backwards compatibility of ConcatenatedModule (fixes #5477) 2017-08-10 00:23:40 +03:00
Tobias Koppers bc67522c74 fixes stack overflow with circular dependencies
fixes #5462
2017-08-09 10:31:01 +02:00
Tobias Koppers b05b49b0f0 fix invalid generated code with scope hoisting and non-number ids 2017-08-08 13:09:47 +02:00
Tobias Koppers 0b8023a106 fixes #5096 2017-08-08 08:15:18 +02:00
Tobias Koppers 7619c43d26 generate more pretty names for nested concatenation 2017-08-07 21:21:53 +02:00
Tobias Koppers 6607cfa4bd remove ordering in ModuleConcatenationPlugin 2017-08-07 20:33:47 +02:00
Tobias Koppers 9f5bffaa61 beautify 2017-08-07 16:15:49 +02:00
Tobias Koppers 334c1c49aa remove unused variable 2017-08-07 16:05:17 +02:00
Tobias Koppers 8835751cb3 fix conflict handling
remove unused code
2017-08-07 15:43:17 +02:00
Tobias Koppers b77a52b43a add reserved words to avoid syntax errors 2017-08-07 14:47:45 +02:00
Tobias Koppers 16a5831620 use old new Buffer api for node 4 2017-08-07 14:39:07 +02:00
Tobias Koppers 2be9c526e4 better names, added export comment 2017-08-07 14:38:54 +02:00
Tobias Koppers a553c3d15d tests and fixes 2017-08-07 14:12:31 +02:00
Tobias Koppers 795f6fcbba fix remaining issues and edge cases 2017-08-07 13:56:50 +02:00
Tobias Koppers abff6b7805 use all imports in a concatenated module 2017-08-07 13:19:24 +02:00
Tobias Koppers ec3aa7be5d Fix import order 2017-08-07 11:53:07 +02:00
Tobias Koppers 907cd16595 fix a bug that prevented the automatic chunk selection to select initial chunks
fixes #5145
fixes #5386
fixes #5285
fixes #5109
2017-07-27 14:32:35 +02:00
Tobias Koppers 32264b8187 Merge branch 'master' into feature/improve-module-concat-bailout-messages 2017-07-25 13:50:53 +02:00
Tobias Koppers 35c8097b6a Make sure it's a real module when choosing for ModuleConcatenation
fixes #5095
2017-07-25 12:53:54 +02:00
Tobias Koppers 42af3d28df Merge pull request #5347 from webpack/cleanup/aggressive-splitting
aggressive-merging-plugin: refactor for more readability
2017-07-24 12:56:36 +02:00
Tobias Koppers 991b360c90 fix useless-escape linting issues 2017-07-24 11:54:06 +02:00
Tobias Koppers 05b913a92c cleanup messages and added more info 2017-07-24 10:29:08 +02:00
Tobias Koppers 2949c598d5 refactor for more readablity 2017-07-24 10:04:55 +02:00
Tobias Koppers a167a7ecf5 allow to use default export of root module in concatenated module in inner modules
better error messages when parsing fails

fixes #5314
#5304
2017-07-21 23:32:47 +02:00
Tobias Koppers 2b0943f618 Merge pull request #5312 from webpack/performance/aggressive-splitting
performance improvements and comments
2017-07-18 15:11:24 +02:00
Tobias Koppers 6fc72dc4cc Merge pull request #5309 from probablyup/optimizations
refactor: reduce array allocations, remove some excess iterations
2017-07-18 14:25:12 +02:00
Tobias Koppers 64c1e8a23a performance improvements and comments 2017-07-18 14:24:42 +02:00
asolove 3f1b7e624c Store relative path cache on compilation to avoid leaking memory. 2017-07-17 23:06:59 -06:00
Evan Scott 529b0ffe94 refactor: use array.find vs array.filter()[0] 2017-07-17 22:19:35 -04: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
Tobias Koppers 6842d50cf9 Call imports with the correct context.
Parse arguments of an import call.
Support strictThisContextOnImports in ConcatenatedModules

fixes #5246
fixes #5135
fixes #5111
2017-07-11 19:08:23 +02:00
Tobias Koppers 4e90f43596 add hash method to concatenated module
fixes #5184
2017-07-07 11:48:52 +02:00