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

[DRAFT] [Testing needed] Update Angular and its dependencies #2065

Closed

Conversation

hudson-newey
Copy link
Member

@hudson-newey hudson-newey commented Jun 14, 2023

Updated Angular and its dependencies

Update Angular and its dependencies

Angular 15 Breaking & Deprecations
Angular 16 Breaking & Deprecations

Changes

  • The use of ~ in SCSS imports (which used to represent node_modules) is now deprecated as has been removed. To ensure all imports still work as expected the node_modules path has been added to the stylePreprocessorOptions paths
  • Updated version of EsLint showed errors that Immutable.Collection<unknown, unknown> could hypothetically never end in object depth. all Immutable.Collection<unknown, unknown> are now strongly typed using the correct FromJS type
  • RouterLinkWithHref is now deprecated as all its functionality is now implemented by RouterLink and is now an "alias type" (incorrect word). I've changed all RouterLinkWithHref types to RouterLink
  • Faker.js address module is now deprecated in favour of location. I have updated the code base accordingly
    • datatype.number() is now deprecated in favour of number.int() or number.float() I have adjusted the code base accordingly
    • Faker.js imageUrl is now replaced with image.url()
    • Faker.js random.alphanumeric() replaced with string.alphanumeric()
    • Faker.js faker.name replaced with faker.person
    • Faker.js faker.random.word() replaced with faker.lorem.word()
  • TypeScript can now trivially infer the types of function parameters from their default values. If the parameter type cannot be overloaded with multiple types, TypeScript now throws an error. I have therefore removed trivially inferred parameter types
  • Removed defaultProject workspace extension as per this issue
  • Since we are now using esbuild, namedChunks and vendorChunk are no longer needed in the angular config. Therefore I have omitted them to reduce console pollution

Problems

  • Must use NodeJS version 16 or 18 from this version forward
  • Removes support for KaiOS and Opera Mini mobile browsers (this is due to the higher TS target)

Issues

Visual Changes

None

Final Checklist

  • Assign reviewers if you have permission
  • Assign labels if you have permission
  • Link issues related to PR
  • Ensure project linter is not producing any warnings (npm run lint)
  • Ensure build is passing on all browsers (npm run test:all)
  • Ensure CI build is passing
  • Ensure docker container is passing (docs)

@hudson-newey hudson-newey changed the title [DRAFT] [Testing needed] Updated Angular and its dependencies [DRAFT] [Testing needed] Update Angular and its dependencies Jun 14, 2023
@hudson-newey hudson-newey added the dependencies Pull requests that update a dependency file label Jun 14, 2023
Copy link
Member

@atruskie atruskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make use of the new esbuild option.

Why are id and recaptchaTokens removed from a bunch of the models?

@hudson-newey
Copy link
Member Author

Why are id and recaptchaTokens removed from a bunch of the models?

the id attribute is implemented by the AbstractModel class (which most models extend), but don't need to override since they don't add additional functionality (an exception is the permissions model).

The above was causing the new version of EsLint to throw errors.

Additionally, recaptchaToken is implemented by the FormComponent which some page components extended. I have a suspicion that recaptchaToken might be needed on some FormComponent's so I'll have to do some testing to see if there are any regressions.

Alternatively, as it doesn't actually affect the performance in any way, I'm happy to disable this EsLint rule in the name of being verbose

@hudson-newey hudson-newey added the work in progress Pull request that is currently a WIP label Jun 15, 2023
@hudson-newey hudson-newey self-assigned this Jun 29, 2023
@hudson-newey
Copy link
Member Author

Superseded by #2085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file work in progress Pull request that is currently a WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants