-
Notifications
You must be signed in to change notification settings - Fork 27.4k
WIP - docs(guide/migration): add "Migrate 1.5 to 1.6" section #15399
Conversation
The most notable changes are: | ||
|
||
- Aligning jqLite with the latest version of jQuery (3.x). | ||
- Implementing long awaited features, such as support for inputs of type `range` or the ability to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... or and the ability to ...
- Aligning jqLite with the latest version of jQuery (3.x). | ||
- Implementing long awaited features, such as support for inputs of type `range` or the ability to | ||
bind to any type of values using `ngRepeat` with `select`. | ||
- Disabling (by default) the pre-assignment of bindings on controller instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which helps with support for native ES6 classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good so far. A few comments
- Implementing long awaited features, such as support for inputs of type `range` or the ability to | ||
bind to any type of values using `ngRepeat` with `select`. | ||
- Disabling (by default) the pre-assignment of bindings on controller instances. | ||
- Changing the default `$location` hash-prefix to `!`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as the previous empty string default was unconventional and confusing
|
||
- **input[type=range]**: Due to [913016](https://github.com/angular/angular.js/commit/9130166767c4792c5d32d08a918fc7becf32c9a6) | ||
and the built-in support for range inputs, the behavior of such elements when bound to `ngModel` | ||
will be different than before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making this section concise:
- The improved support for range means that behaviour of
input[range]
element when bound tongModel
has changed. See [link to section below]
etc.
- **ngModelOptions**: Due to [87a2ff](https://github.com/angular/angular.js/commit/87a2ff76af5d0a9268d8eb84db5755077d27c84c), | ||
if a setting is not applied on `ngModelOptions`, it will be inherited from the nearest | ||
`ngModelOptions` ancestor. Previously, it would default to `undefined`. | ||
The programmatic API for `ngModelOptions` has also changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this needs changing
(`''`) to the bang (`'!'`). | ||
|
||
- **jqLite**: | ||
- Due to [fc0c11](https://github.com/angular/angular.js/commit/fc0c11db845d53061430b7f05e773dcb3fb5b860), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in this one it could look something like:
- jqLite is more aligned to jQuery 3 which required the following changes (see [link to section]):
- keys for
.data()
and.css()
are now camelCased- setting boolean attributes to empty string no longer removes the attribute
- calling
.val()
on a multiple select will now return an empty array if no option is selected
Below is the full list of breaking changes: | ||
|
||
|
||
<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I have to stop review and do childcare. But I guess that most of this is generated from the changelog right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this, but the messages are curated 😃
|
||
|
||
<br /> | ||
### ServiceCore: s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServiceCore: s
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops! Misplaced multiple cursor.
and `''` as "empty". | ||
|
||
|
||
Below is the full list of breaking changes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth putting in a mini-contents list here with links to each of the sections below.
E.g.
- core directives
- forms
- input
- ngBind
- ngModel
- ngModelOptions
- ...
- core services
- ...
etc
- ...
the `$route` service will no longer instantiate controllers nor call `resolve` or | ||
`template`/`templateUrl` functions for routes that successfully `redirectTo` other routes. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And well done if you managed to get this far :-)
<form ng-model-options="{updateOn: 'blur'}"> | ||
<input ng-model="..." /> | ||
</form> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this example is wrong :( ngModel
inherits its closest ngModelOptions
if it doesn't have its own.
(Good thing that commit got reverted 😃)
5c3350b
to
88c03c9
Compare
@petebd, PTAL |
Let me TAL in the morning |
If it is OK, I will merge it and we can iterate. |
unconventional and confusing. | ||
- Reporting possibly unhandled promise rejections that would otherwise go unnoticed. | ||
|
||
Another major change is the removal of the **Expression Sandbox**. This should not affect applications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... should not require changes to your application (and may give it a small performance boost), but ...
converts an invalid value (empty: `null`, `undefined`, `false` ..., out of bounds: greater than | ||
max, less than min) to a valid value, the input will in turn set the model to this new valid value | ||
via `$setViewValue`. | ||
- This means a range input will never be required and never have a non-Number model value, once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This means a range input will never be required"? Should this be "will never have the required validation error"?
#### **form**: | ||
|
||
<minor /> | ||
Due to [9e24e7](https://github.com/angular/angular.js/commit/9e24e774a558143b3478536911a3a4c1714564ba), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make all the "Due to XXXX, " bits bold? This will help to distinguish the start of a new BC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small changes. But once they are done let's merge this in.
you actually want whitespace to appear as the transcluded content, then you can force it to be used | ||
by adding a comment to the whitespace. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should provide an example of adding a comment to this. E.g.
<my-component><!- force-whitespace --> </my-component>
fallback content will be used instead. Previously, whitespace only transclusion would be treated as | ||
the transclusion being "not empty", which meant that fallback content was not used in that case. If | ||
you actually want whitespace to appear as the transcluded content, then you can force it to be used | ||
by adding a comment to the whitespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by adding an HTML comment to the whitespace.
whitespace in attributes is no longer trimmed automatically. This includes leading and trailing | ||
whitespace, and attributes that are purely whitespace. To migrate, attributes that require trimming | ||
must now be trimmed manually. A common case where stray whitespace can cause problems is when | ||
attribute values are compared, for example in an `$observe`r. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$observer
r renders poorly. Instead let's say "for example in $observe
."
|
||
<hr /> | ||
<minor /> | ||
Due to [fb6634](https://github.com/angular/angular.js/commit/fb663418710736161a6b5da49c345e92edf58dcb), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a BIG-ONE that needs to be listed at the top. It will affect every application that uses JSONP.
I'll merge as soon as Travis completes |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Docs update.
What is the current behavior? (You can also link to an open issue here)
No migration docs for 1.5 -> 1.6.
What is the new behavior (if this is a feature change)?
Migration docs for 1.5 -> 1.6.
Does this PR introduce a breaking change?
No.
Please check if the PR fulfills these requirements
Tests for the changes have been added (for bug fixes / features)Other information:
This needs to be updated with the changes that land on future RCs.