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

Update to Angular 1.6.9 #668

Merged
merged 3 commits into from
Feb 13, 2018
Merged

Update to Angular 1.6.9 #668

merged 3 commits into from
Feb 13, 2018

Conversation

robertknight
Copy link
Member

Update to the current stable version of Angular (1.5.6 => 1.6.9). The full changelog has all the details including breaking changes since 1.5.x.

The main backwards incompatible change which affects us is that by default component inputs are no longer available in controller constructors but only during/after the $onInit method is called [1]. There is a preAssignBindingsEnabled backwards compatibility helper which preserves the previous behaviour. I have enabled this in both the sidebar application and tests for components which need it.

See commit messages for details on other fixes required.

[1] Controllers in Angular are effectively classes and this change was introduced to make it possible to use ES6 classes as components, plus it has the benefit of encouraging the init code for a component to be put in one obvious place.

The main change that affects us is that component inputs/bindings are no
longer available as controller properties in the constructor by default.
Instead this logic should go in a controller's `$onInit` method.

In this commit use the `$compileProvider.preAssignBindingsEnabled`
compatibility helper which preserves the Angular <= 1.5 behavior. This
is being removed in Angular 1.7.
Fix occurrences of a "multilink" [1] error during test for the
annotation save button.

Replace calls to the link function with direct assignments to controller
properties.

[1] https://code.angularjs.org/1.6.9/docs/error/$compile/multilink
Fix a test failure due to a subtle issue with the interaction between
the `$q` service, `AnnotationController#delete` and `$timeout.flush` in
tests.

Instantiating the rejected promise _before_ calling `$timeout.flush`
resulted in Angular's unhandled promise checking code being triggered
in the test.
@codecov
Copy link

codecov bot commented Feb 12, 2018

Codecov Report

Merging #668 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #668      +/-   ##
==========================================
+ Coverage   91.03%   91.05%   +0.01%     
==========================================
  Files         135      135              
  Lines        5397     5397              
  Branches      934      934              
==========================================
+ Hits         4913     4914       +1     
+ Misses        484      483       -1
Impacted Files Coverage Δ
src/sidebar/components/excerpt.js 98.11% <0%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b9b6ef...e68aa1a. Read the comment docs.

@seanh
Copy link
Contributor

seanh commented Feb 13, 2018

It's hard to test everything and know for sure that a framework update like this didn't break anything, but on a brief look I couldn't find any problems

@seanh seanh merged commit c4beb73 into master Feb 13, 2018
@seanh seanh deleted the ng-16-update branch February 13, 2018 14:34
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.

2 participants