684 Commits

Author SHA1 Message Date
Charles Lyding
258dfc281e fix(@ngtools/webpack): downlevel constructor parameter type information
The TypeScript `emitDecoratorMetadata` option does not support forward references of ES2015 classes due to the TypeScript compiler transforming the metadata into a direct reference of the yet to be defined class.  This results in a runtime TDZ error.  This is a known limitation of the `emitDecoratorMetadata` option.
The change in the PR removes the need for the option by storing the information in a static property function via the use of the tsickle `ctorParameters` transformation.  By leveraging the existing functionality, no changes to the framework code is necessary.  Also, minimal new code is required within the CLI, as the relevant tsickle code can be extracted and used with several local modifications.
2019-05-23 19:12:40 +02:00
Renovate Bot
f651a2bd30 build: update webpack to version 4.32.1 2019-05-22 14:25:36 +02:00
Alex Eagle
ec731f0454 docs: don't reference next.angular.io
When we cut a release, this moves to angular.io.
Use v8.angular.io in places where angular.io is currently a 404.

Fixes https://github.com/angular/angular/issues/30407
2019-05-21 09:08:40 -04:00
Filipe Silva
a491b09800 fix(@ngtools/webpack): import factory from original declaration file
Fix #14399
2019-05-15 14:11:21 -07:00
Filipe Silva
85b2016e77 test(@ngtools/webpack): support libs on transformer test errors 2019-05-15 14:11:21 -07:00
Filipe Silva
f4be46513b refactor(@ngtools/webpack): add forwardSlashPath util
I figured one day I'd get tired of repeating this replace. Today was that day.
2019-05-15 14:11:21 -07:00
Filipe Silva
fb8548160d test(@ngtools/webpack): add test for changing import arg name 2019-05-15 14:11:21 -07:00
Renovate Bot
061b941722 build: update webpack to version 4.31.0 2019-05-10 15:08:23 -07:00
Alan Agius
4263cc6e63 fix(@ngtools/webpack): fixes ngcc error when project name is the same or partially the same as a module name
FIxes #14317
2019-05-07 16:13:19 -06:00
Filipe Silva
b9479b5230 fix(@ngtools/webpack): log ngcc info messages (#14320)
Fix #14194
2019-05-07 12:39:16 -06:00
Renovate Bot
da1f3386d0 build: update typescript to version 3.4.5 (#14258) 2019-05-07 12:30:53 -06:00
Filipe Silva
c8b4f4a57c build: update to Angular 8.0.0-beta.14 2019-04-24 07:11:21 -10:00
Alex Eagle
d88175ddf1 Revert "build: update rxjs to version 6.5.1"
This reverts commit c4613ced63a901fe327e062d2be474d72ccc56f1.
2019-04-23 11:23:51 -07:00
Renovate Bot
c4613ced63 build: update rxjs to version 6.5.1 2019-04-23 08:07:56 -07:00
Alan Agius
09bed6ffa8 fix(@ngtools/webpack): set correct peerDependencies for TypeScript and Angular Compiler CLI
In version 8, we support only Angular 8+ which only supports TypeScript >=3.4 < 3.5
2019-04-23 08:02:56 -07:00
Filipe Silva
c8d9e545ba feat(@ngtools/webpack): remove importFactories option
It will just be always be used when applicable.
2019-04-22 16:16:58 -07:00
Renovate Bot
217afe5def build: update typescript to version 3.4.4 2019-04-19 10:53:37 -07:00
Renovate Bot
609041815e build: update webpack to version 4.30.0 2019-04-16 09:39:27 -07:00
Alan Agius
82193807d5 fix(@ngtools/webpack): replace bootstrap code under Ivy unless running in JIT mode
The bootstrap code always needs to be replaced if not running in JIT mode as other wise the entire compiler will be pulled in because we will not replace the bootstrapping code to use `platform-browser` instead of `platform-browser-dynamic`.
2019-04-16 06:58:19 -07:00
Filipe Silva
6d7d2ebd3c feat(@ngtools/webpack): support loadchildren string syntax in Ivy 2019-04-13 10:23:02 -07:00
Filipe Silva
b7dfdb8643 build: update to Angular 8.0.0-beta.12 2019-04-13 10:23:02 -07:00
Filipe Silva
b6b00ebc98 build: update typescript to version 3.4.3 2019-04-13 10:23:02 -07:00
Alan Agius
801f667078 feat(@ngtools/webpack): redirect ngcc errors and warnings to webpack 2019-04-04 19:50:20 -07:00
Alan Agius
2061ede09b style: remove todo comment from updateClassDeclaration
A transformer should not mutate existing nodes, ever. If you intend to modify some part of the node, the ts.update* methods are correct. Or you can replace a node entirely via ts.create* operations, but there are cases where introducing entirely synthetic nodes will break TS output.

Hence using the updateClassDeclaration in this case is the correct approach.

This has also been raised in the slack #ts-core channel as TypeScript have been looking to get to the bottom of this Microsoft/TypeScript#29365 (comment), which seemed to have been caused by mutating the node.
2019-04-04 11:41:13 -07:00
Alan Agius
d917c7bca6 build: update to angular version 8.0.0-beta.11 2019-04-04 09:27:35 -07:00
Filipe Silva
ed0e6aab57 feat(@angular-devkit/build-angular): support TS web workers 2019-04-02 04:49:34 -07:00
Filipe Silva
1d66e55547 feat(@ngtools/webpack): reuse compiler host in webpack child compilations 2019-04-02 04:49:34 -07:00
Alan Agius
4595d9c598 build: update angular packages to 8.0.0-beta.10 2019-04-01 02:54:41 -07:00
Alan Agius
d2e22e9781 feat(@ngtools/webpack): add NGCC as part of the workflow
When add module is resolved, it will try to convert the module using the `NGCC` API.

NGCC will be run hooked to the compiler during the module resolution, using the Compiler Host methods 'resolveTypeReferenceDirectives' and 'resolveModuleNames'. It will process a single entry for each module and is based on the first match from the Webpack mainFields.

When Ivy is enabled we also append the '_ivy_ngcc' suffixed properties
to the mainFields so that Webpack resolver will resolve ngcc processed
modules first.
2019-04-01 02:54:41 -07:00
Alan Agius
655626c284 refactor(@ngtools/webpack): move interfaces to separate file
This is to avoid circular imports
2019-04-01 02:54:41 -07:00
Alan
7915a582cf fix(@ngtools/webpack): changes in non module code are not picked up when using barrel files
Fixes #13975
2019-03-29 14:47:03 -07:00
Alan
871eb69c3b fix(@ngtools/webpack): replace resources should return class node when modified
This is also the root cause of spec large fail occasionally as we keep checking the child class nodes
2019-03-29 14:45:06 -07:00
Alan
54d2be9497 fix(@ngtools/webpack): don't invalidate cache after first run
At the moment, since there are no old files in the compilation it will cause all source files to be invalidate after the first run. This shouldn't be done as it will slow down the 2nd recompilation.
2019-03-29 14:45:06 -07:00
Filipe Silva
8d82e9812d refactor(@ngtools/webpack): simplify a call using await 2019-03-29 14:39:48 -07:00
Filipe Silva
8e3e755995 feat(@angular-devkit/build-angular): add experimentalImportFactories option 2019-03-29 14:39:48 -07:00
Filipe Silva
bc7da5d076 feat(@ngtools/webpack): support import syntax for loadChildren with ViewEngine
This feature ONLY matches the format below:
```
loadChildren: () => import('IMPORT_STRING').then(m => m.EXPORT_NAME)
```

It will not match nor alter variations, for instance:
- not using arrow functions
- not using `m` as the module argument
- using `await` instead of `then`
- using a default export (https://github.com/angular/angular/issues/11402)

The only parts that can change are the ones in caps: IMPORT_STRING and EXPORT_NAME.
2019-03-29 14:39:48 -07:00
Filipe Silva
b54a9379a6 feat(@ngtools/webpack): add option to control lazy route discovery 2019-03-29 14:39:48 -07:00
Renovate Bot
4782b1b3a4 build: update typescript to version 3.3.4000 2019-03-22 15:32:04 -07:00
Filipe Silva
6e3d2e0c4d feat(@ngtools/webpack): support Angular 8
This requires updating projects to TypeScript 3.3
2019-03-20 12:29:01 -07:00
Alan
345ab4817a fix(@ngtools/webpack): getCurrentDirectory should not return a devkit path
At the moment we are leaking devkit paths as `getCurrentDirectory` is used by the ngtsc compiler if no `rootDir` directories is provided.

`getCurrentDirectory` is also used to contruct the `rootDirs` option which is causing this to be incorrect as under Windows as `rootDirs` will be have an invalid value example: `/c/foo/bar`

This PR complements https://github.com/angular/angular/pull/29151

**Note** that this currently works because we are normalizing paths with posix seperators and is mimicking the behaviour of the logical file system used by the ngtsc.

Fixes: #13849
2019-03-07 16:02:53 -08:00
Mathias Raacke
dfb08b95b7 feat(@ngtools/webpack): allow .svg files as templates
With directTemplateLoading enabled, components
can now use .svg files as templates. For AOT builds,
the Angular compiler host now reads .svg files
directly when reading component templates.
For JIT builds, replaceResources creates a require call
that directly uses raw-loader instead of using the
loader provided by the current webpack configuration.

Closes #10567
2019-03-05 10:16:41 -08:00
Renovate Bot
ef523d0d41 build: update webpack to version 4.29.6 2019-03-04 09:34:41 -08:00
Alan Agius
ae13974f1d build: update to rxjs 6.4 2019-02-26 08:33:48 -08:00
Renovate Bot
9efa933937 build: update webpack to version 4.29.5 2019-02-19 13:51:53 -08:00
Renovate Bot
1bba17fa0d build: update webpack to version 4.29.4 2019-02-17 11:29:17 -08:00
Filipe Silva
91f5be769d fix(@ngtools/webpack): don't load ngfactories for lazy routes with Ivy
Supersedes https://github.com/angular/angular-cli/pull/13524
2019-02-15 15:10:55 -08:00
Renovate Bot
4ecd232733 build: update webpack to version 4.29.3 (#13608) 2019-02-07 08:24:43 -08:00
Renovate Bot
37b4714b97 build: update webpack to version 4.29.1 2019-02-05 21:28:52 -08:00
clydin
fa6795a847 Fully resolve correct @ngtools/webpack loader (#13549)
* refactor(@ngtools/webpack): support import-based loader resolution

* fix(@angular-devkit/build-angular): ensure correct ngtools loader version

By using the the direct import approach, the loader will be guaranteed to originate from the same package version/location as the other `@ngtools/webpack` imports.

Fixes #13539
2019-02-05 21:12:31 -08:00
Filipe Silva
08e24837a0 fix(@ngtools/webpack): provide a TS-like path to ngProgram.listLazyRoutes
The webpack plugin was leaking our internal Path abstraction to the Angular compiler via the `ngProgram.listLazyRoutes` call.

This Path abstraction is provided by `@angular-devkit/core` and shouldn't leak. Instead a TS-like path should be provided to the Angular program.

Fix #13531
2019-01-30 11:23:34 -08:00