Skip to content
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

feat: Update to Angular 16 #2010

Merged

Conversation

HendrikJanssen
Copy link
Contributor

@HendrikJanssen HendrikJanssen commented May 8, 2023

  • Removed a test case that was deprecated and is now removed for Angular 16
  • Pulled minimum node version to 16 as it is now required by angular
  • Updated ng-packagr to a version that supports v16, updated schema references as they were outdated

@changeset-bot
Copy link

changeset-bot bot commented May 8, 2023

🦋 Changeset detected

Latest commit: 09e2a87

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@HendrikJanssen HendrikJanssen force-pushed the Feat_update_to_angular_16 branch from e6c0f5c to febb6c1 Compare May 8, 2023 10:34
@HendrikJanssen
Copy link
Contributor Author

HendrikJanssen commented May 8, 2023

It seems the moduleNameMapper config option in jest.config.js was misconfigured and failed to execute tests when importing from the "compiled" module. I fixed it by using

moduleNameMapper: {
    '^apollo-angular': '<rootDir>/src/',
}

Instead of

moduleNameMapper: {
    '^apollo-angular': '<rootDir>',
}

While at it, I removed the absolute path for the resolver option (unnecessary) and migrated the "ts-jest" config options to be included in the transform options of jest-preset-angular as detailed in https://thymikee.github.io/jest-preset-angular/docs/getting-started/options#exposed-configuration since the globals way of doing it is deprecated.

@HendrikJanssen HendrikJanssen force-pushed the Feat_update_to_angular_16 branch from febb6c1 to 9148f5f Compare May 8, 2023 10:58
@HendrikJanssen
Copy link
Contributor Author

HendrikJanssen commented May 8, 2023

Alright, the demoproject had trouble building: "Module apollo-angular could not be found".

I fixed it by pointing the paths option in the tsconfig.app.json to the built apollo-angular package, since pointing it to src/ would surface some compilation errors because of typescript. That does actually seem like a dirty hack though, not sure how module resolution worked before that, could you point me in the right direction @PowerKiKi ?

@PowerKiKi
Copy link
Collaborator

Actually your workaround makes sense to me. And I don't have any specific knowledge to share about how it used to work before.

@kamilkisiela do you have any insight regarding module resolutions ?

@fromsomnia fromsomnia mentioned this pull request May 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
- Removed a test case that was deprecated and is now removed for Angular 16
- Pulled minimum node version to 16 as it is now required by angular
- Updated ng-packagr to a version that supports v16, updated schema references as they were outdated
- Migrate away from deprecated Jest `globals` way of doing
- Remove Browserlist settings and set target to es2022 to fixes warnings when `yarn workspace demo start`
@PowerKiKi PowerKiKi force-pushed the Feat_update_to_angular_16 branch from 92eacd6 to 09e2a87 Compare May 11, 2023 02:08
@PowerKiKi PowerKiKi merged commit ea8b703 into kamilkisiela:master May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants