Skip to content

feat: Angular 15 support #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 30, 2022
Merged

feat: Angular 15 support #97

merged 11 commits into from
Nov 30, 2022

Conversation

NathanWalker
Copy link
Contributor

@NathanWalker NathanWalker commented Nov 13, 2022

With TypeScript ~4.7.4...

  • fix @ngtools/webpack errors:
ERROR in ./src/main.ts
Module build failed (from ../../node_modules/@ngtools/webpack/src/index.js):
Error: Emit attempted before Angular Webpack plugin initialization.
    at /Users/nstudio/Documents/github/NativeScript/angular/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  • fix @angular-devkit/build-angular errors:
ERROR in ../../node_modules/@nativescript/core/bundle-entry-points.js
Module build failed (from ../../node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
Error: Unknown option: .scriptTarget. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at validate (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/validation/options.js:86:25)
    at loadPrivatePartialConfig (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:58:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Object.<anonymous> (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:122:25)
    at Generator.next (<anonymous>)
    at step (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:261:32)
    at evaluateAsync (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:291:5)
    at /Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:93:9
    at new Promise (<anonymous>)
    at Object.async (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:92:14)
    at Object.loader (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/babel-loader/lib/index.js:111:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
ERROR in ../../node_modules/@nativescript/core/inspector_modules.ios.js
Module build failed (from ../../node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
Error: Unknown option: .scriptTarget. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at validate (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/validation/options.js:86:25)
    at loadPrivatePartialConfig (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:58:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Object.<anonymous> (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:122:25)
    at Generator.next (<anonymous>)
    at step (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:261:32)
    at evaluateAsync (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:291:5)
    at /Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:93:9
    at new Promise (<anonymous>)
    at Object.async (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:92:14)
    at Object.loader (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/babel-loader/lib/index.js:111:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@cla-bot cla-bot bot added the cla: yes label Nov 13, 2022
@NathanWalker NathanWalker changed the title Feat/angular 15 feat: Angular 15 support Nov 13, 2022
@NathanWalker
Copy link
Contributor Author

With TypeScript ~4.8.2...

  • [ ]fix @angular-devkit/build-angular errors:
ERROR in ./src/main.ts
Module build failed (from ../../node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
Error: Unknown option: .scriptTarget. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at validate (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/validation/options.js:86:25)
    at loadPrivatePartialConfig (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:58:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at Object.<anonymous> (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/@babel/core/lib/config/partial.js:122:25)
    at Generator.next (<anonymous>)
    at step (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:261:32)
    at evaluateAsync (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:291:5)
    at /Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:93:9
    at new Promise (<anonymous>)
    at Object.async (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/gensync/index.js:92:14)
    at Object.loader (/Users/nstudio/Documents/github/NativeScript/angular/node_modules/babel-loader/lib/index.js:111:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  • fix breaking changes
ERROR in ../../packages/angular/src/lib/legacy/router/page-router-outlet.ts:35:3 - error TS2416: Property 'get' in type 'DestructibleInjector' is not assignable to the same property in base type 'Injector'.
  Type '<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags) => T' is not assignable to type '{ <T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & { optional?: false; }): T; <T>(token: ProviderToken<T>, notFoundValue: null, options: InjectOptions): T; <T>(token: ProviderToken<...>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T; <T>(token: ProviderToken<...>, notFou...'.
    Types of parameters 'flags' and 'options' are incompatible.
      Type 'InjectOptions & { optional?: false; }' is not assignable to type 'InjectFlags'.

35   get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T {
     ~~~

ERROR in ../../packages/angular/src/lib/legacy/router/page-router-outlet.ts:352:70 - error TS2345: Argument of type 'DestructibleInjector' is not assignable to parameter of type 'Injector'.
  Types of property 'get' are incompatible.
    Type '<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags) => T' is not assignable to type '{ <T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & { optional?: false; }): T; <T>(token: ProviderToken<T>, notFoundValue: null, options: InjectOptions): T; <T>(token: ProviderToken<...>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T; <T>(token: ProviderToken<...>, notFou...'.

352       loaderRef = location.createComponent(factory, location.length, injector);
                                                                         ~~~~~~~~

ERROR in ../../packages/angular/src/lib/legacy/router/page-router-outlet.ts:355:19 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(componentType: Type<DetachedLoader>, options?: { index?: number; injector?: Injector; ngModuleRef?: NgModuleRef<unknown>; environmentInjector?: NgModuleRef<unknown> | EnvironmentInjector; projectableNodes?: Node[][]; }): ComponentRef<...>', gave the following error.
    Type 'DestructibleInjector' is not assignable to type 'Injector'.
  Overload 2 of 2, '(componentFactory: ComponentFactory<DetachedLoader>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: NgModuleRef<any> | EnvironmentInjector): ComponentRef<...>', gave the following error.
    Argument of type 'typeof DetachedLoader' is not assignable to parameter of type 'ComponentFactory<DetachedLoader>'.
      Type 'typeof DetachedLoader' is missing the following properties from type 'ComponentFactory<DetachedLoader>': selector, componentType, ngContentSelectors, inputs, and 2 more.

355       loaderRef = location.createComponent(DetachedLoader, { index: location.length, injector, environmentInjector });
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ../../node_modules/@angular/core/index.d.ts:9535:9
    9535         injector?: Injector;
                 ~~~~~~~~
    The expected type comes from property 'injector' which is declared here on type '{ index?: number; injector?: Injector; ngModuleRef?: NgModuleRef<unknown>; environmentInjector?: NgModuleRef<unknown> | EnvironmentInjector; projectableNodes?: Node[][]; }'

@nx-cloud
Copy link

nx-cloud bot commented Nov 30, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bd7c650. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

NathanWalker and others added 4 commits November 30, 2022 09:30
…re the navigatedTo event fires (#100)

* fix(router): fix navigation when clearing history and navigating before the navigatedTo event fires

* fix: mark cache for clearing for better consistency
@NathanWalker NathanWalker merged commit 51ad39e into main Nov 30, 2022
@NathanWalker NathanWalker deleted the feat/angular-15 branch November 30, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants