Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

WIP - docs(guide/migration): add "Migrate 1.5 to 1.6" section #15399

Closed
wants to merge 4 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Nov 16, 2016

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

Other information:
This needs to be updated with the changes that land on future RCs.

@gkalpak gkalpak changed the title docs(guide/migration): add "Migrate 1.5 to 1.6" section WIP - docs(guide/migration): add "Migrate 1.5 to 1.6" section Nov 16, 2016
@gkalpak gkalpak added this to the 1.6.0-rc.1 milestone Nov 16, 2016
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
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor

@petebacondarwin petebacondarwin left a 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 `!`.
Copy link
Contributor

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.
Copy link
Contributor

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 to ngModel 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.
Copy link
Contributor

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),
Copy link
Contributor

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 />
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

ServiceCore: s??

Copy link
Member Author

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:
Copy link
Contributor

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.


Copy link
Contributor

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>
```
Copy link
Member Author

@gkalpak gkalpak Nov 17, 2016

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 😃)

@gkalpak gkalpak force-pushed the docs-guide-migrate-to-1.6 branch from 5c3350b to 88c03c9 Compare November 17, 2016 16:41
@gkalpak
Copy link
Member Author

gkalpak commented Nov 17, 2016

@petebd, PTAL

@petebacondarwin
Copy link
Contributor

Let me TAL in the morning

@petebacondarwin
Copy link
Contributor

If it is OK, I will merge it and we can iterate.
I think it will be better to get something out there.

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
Copy link
Contributor

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
Copy link
Contributor

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),
Copy link
Contributor

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.

Copy link
Contributor

@petebacondarwin petebacondarwin left a 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.


Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

$observerr renders poorly. Instead let's say "for example in $observe."


<hr />
<minor />
Due to [fb6634](https://github.com/angular/angular.js/commit/fb663418710736161a6b5da49c345e92edf58dcb),
Copy link
Contributor

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.

@petebacondarwin
Copy link
Contributor

I'll merge as soon as Travis completes

@gkalpak gkalpak deleted the docs-guide-migrate-to-1.6 branch November 21, 2016 11:59
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants