Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Update Angular project package dependencies #262

Merged
merged 1 commit into from
Dec 5, 2017

Conversation

CloudNiner
Copy link
Contributor

Overview

Actually updates dependencies to the latest version of Angular 4. Changes to package.json in #256 didn't also update yarn.lock and thus weren't reflected in the build.

Notes

This caused a few build issues:

One is that climate-change-components specifies versions
of Angular to use while building. If the Angular versions
here don't match that, we get build issues that look like:

Error encountered resolving symbol values statically.
Calling function 'InjectionToken', function calls are
not supported.

To address this it is possible to force our project's
typescript compiler to always use the versions of certain
packages via the "files" config of tsconfig.json. This
gives us a little flexibility in which Angular version
gets used in the parent project. We still should respect
the Angular version requirements of the components lib,
but that restriction is far more lax than the specific
Angular version the components lib is built with.

Another build issue was caused by ng2nouislider being
updated to 1.7.5 based on the ^1.6.2 restriction in
package.json. 1.7.5. is built with a version of Angular
CLI designed for use with Angular 5. This led to the
error:

ERROR in Error: Metadata version mismatch for module
/opt/planit/angular/planit/node_modules/ng2-nouislider/src/nouislider.d.ts,
found version 4, expected 3, resolving symbol SharedModule
in /opt/planit/angular/planit/src/app/shared/shared.module.ts,
resolving symbol SharedModule in
/opt/planit/angular/planit/src/app/shared/shared.module.ts

A GitHub issue on a different project with the same
issue provided enough info to pinpoint the solution,
which was to use a version of ng2nouislider built with
Angular CLI compatible with Angular 4.

primefaces/primeng#4401

Testing Instructions

  • docker-compose build angular
  • ./scripts/server should still build and the app should function as before
  • ./scripts/test should continue to work

Much fun here.

Updates dependencies to the latest version of Angular 4.

This caused a few build issues:

One is that climate-change-components specifies versions
of Angular to use while building. If the Angular versions
here don't match that, we get build issues that look like:

"Error encountered resolving symbol values statically.
Calling function 'InjectionToken', function calls are
not supported."

To address this it is possible to force our project's
typescript compiler to always use the versions of certain
packages via the "files" config of tsconfig.json. This
gives us a little flexibility in which Angular version
gets used in the parent project. We still should respect
the Angular version requirements of the components lib,
but that restriction is far more lax than the specific
Angular version the components lib is built with.

Another build issue was caused by ng2nouislider being
updated to 1.7.5 based on the ^1.6.2 restriction in
package.json. 1.7.5. is built with a version of Angular
CLI designed for use with Angular 5. This led to the
error:

"ERROR in Error: Metadata version mismatch for module
/opt/planit/angular/planit/node_modules/ng2-nouislider/src/nouislider.d.ts,
found version 4, expected 3, resolving symbol SharedModule
in /opt/planit/angular/planit/src/app/shared/shared.module.ts,
resolving symbol SharedModule in
/opt/planit/angular/planit/src/app/shared/shared.module.ts"

A GitHub issue on a different project with the same
issue provided enough info to pinpoint the solution,
which was to use a version of ng2nouislider built with
Angular CLI compatible with Angular 4.

primefaces/primeng#4401
@CloudNiner CloudNiner merged commit d4c4ef3 into develop Dec 5, 2017
@CloudNiner CloudNiner deleted the bugfix/awf/npm-package-lockfile-mismatch branch December 5, 2017 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants