Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/Polymer/docs into 2-maste…
Browse files Browse the repository at this point in the history
…r-merge
  • Loading branch information
Arthur Evans committed Oct 7, 2016
2 parents dd2ae31 + dc59505 commit 3f38a2d
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 5 deletions.
8 changes: 8 additions & 0 deletions app/1.0/blog.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---
- title: "Please Welcome Polymer 1.7"
path: /1.0/blog/2016-10-03-1.7-release
published: 2016-10-06
author: polymer-team
description: "Polymer 1.7 provides forward compatibility features, plus a few bug fixes."
tags:
- blog
- announcements
- title: "Polymer 2.0 Preview"
path: /1.0/blog/2016-09-09-polymer-2.0
published: 2016-09-09
Expand Down
29 changes: 29 additions & 0 deletions app/1.0/blog/2016-10-03-1.7-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "1.7 Release"

---
_We announce significant releases here on the blog, highlighting the major new features as well as breaking changes. As always, we'd love to get your feedback, issues, and PR's, so tweet us [@polymer](https://twitter.com/polymer) or contribute to the [Github](https://github.com/Polymer)._

The primary goal of the upcoming Polymer 2.0 release is to take advantage of native, cross-browser support for Web Components. With this in mind, we're pleased to release Polymer 1.7, which introduces features allowing you to use 2.0-compatible syntax in 1.x elements.

## Polymer 1.7

Polymer 1.7.0 provides forward compatibility features that let you build elements that run under both 1.0 and 2.0.

While you can use these features now, the team intends to release a tool to help automate these changes. If you have a large project, you might want to wait for the migration tool to be available.

The new syntax is not required for current Polymer 1.x elements, but using the new syntax will make it easier to port elements to 2.0, which requires it.

### `<slot>` element

Elements can opt-in to using the new `<slot>` element and `::slotted()` CSS selector from shadow DOM v1.

These replace the `<content>` element and `::content` selector in shadow DOM v0. The v1 API is somewhat more restrictive, so you should read up on the details before making changes.

### `html` selector in `<style is="custom-style">`, `:host > * ` selector in elements

Polymer 2.0 removes support for the `:root` selector. In a `custom-style` element, you can use `html` where you used to use `:root`. Inside an element, you can use `:host > *`.

Polymer 1.7 adds support for using the `html` selector in a custom-style element, so you can use the 2.0-compatible syntax. (The `:host > *` syntax was already supported.)

For more details, read the full release notes here: <a href="https://www.polymer-project.org/1.0/docs/release-notes#v-1-7-0">Release 1.7.0</a>
8 changes: 6 additions & 2 deletions app/1.0/blog/routing/demo1.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@
// Route objects are composed of the `path` that we want to
// match on, the `prefix`, which is everything that has already
// been matched by someone else before it got to us, and
// a queryParams object, which represents the ?key=value part
// an __queryParams object, which represents the ?key=value part
// of the URL.
return {path: '/store/garden', prefix: '', queryParams: {}}
// __queryParams is preceded by underscores because unless you're
// doing the power-user thing of generating your own route objects,
// you want to access query params directly from the <app-route>
// element.
return {path: '/store/garden', prefix: '', __queryParams: {}}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/1.0/docs/devguide/data-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Related tasks:
Sometimes an element has two paths that point to the same object.

For example, an element has two properties, `users` (an array) and `selectedUser` (an object). When
a user is selected, `selectedUser` refers one of the objects in the array.
a user is selected, `selectedUser` refers to one of the objects in the array.


![A user-list element and an array with four items labeled \[0\] through \[3\]. The user-list has two properties, users and selectedUser. The users property is connected to the array by an arrow labeled 1. The selectedUser property is connected to the array item, \[1\] by an arrow labeled 2.](/images/1.0/data-system/linked-paths-new.png)
Expand Down
2 changes: 1 addition & 1 deletion app/1.0/docs/devguide/local-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Polymer.dom(this.root).appendChild(toLocal);
// Insert to the local DOM
var toInsert = document.createElement('div');
var beforeNode = Polymer.dom(this.root).childNodes[0];
Polymer.dom(this.root).insertBefore(toLocal, beforeNode);
Polymer.dom(this.root).insertBefore(toInsert, beforeNode);
```

You can use the [automatic node finding](#node-finding) feature to locate
Expand Down
116 changes: 115 additions & 1 deletion app/1.0/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,120 @@ title: Release notes
}
</style>


## [Release 1.7.0](https://github.com/polymer/polymer/tree/v1.7.0) (2016-09-29) {#v-1-7-0}

This release includes forward compatibility features that let you build elements that run under
both Polymer 1.7+ and Polymer 2.0.

The syntax changes described here are **not required** for current Polymer 1.x elements, but using
the new syntax makes for an easier transition to 2.x. The Polymer team plans to provide a
tool to automate these and other changes required for moving from 1.x to 2.0, so if you have a large
project, you may want to wait for an announcement about the migration tool.

### Shadow DOM v1 slots

To provide a smooth migration path from Polymer 1.x to 2.x, this release lets you
opt-in to using the new `<slot>` element, and `::slotted()` CSS selector from shadow DOM v1 in place
of the `<content>` element and `::content` selector from shadow DOM v0. (This release doesn't
actually add support for shadow DOM v1, it just lets you use a forward-compatible syntax.)
)

To update an element:

* Each `<content>` insertion point must be changed to `<slot>`.
* Insertion points that selected content using <code>&lt;content select="<var>selector</var>"&gt;</code>
must be changed to named slots: <code>&lt;slot name="<var>slot_name</var>"&gt;</code>. Note that
in shadow DOM v1, distributed content can _only_ be selected by slot name, not by tag name,
attributes or CSS classes.
* Users of your element must use the matching new <code>slot="<var>slot_name</var>"</code>
attribute to distribute content into a named slot.
* Any `::content` CSS selectors must be replaced with <code>::slotted(<var>selector</var>)</code>,
where <var>selector</var> is [compound selector](https://drafts.csswg.org/selectors-4/#compound)
that identifies a **top-level distributed child**. That is, `::slotted(.foo)` is equivalent to
`::content > .foo`.

In Polymer 1.7, elements written with slots are re-written at runtime into the
equivalent `<content>` elements and style rules, to work with shadow DOM v0.

As written:
{.caption}

```html
<dom-module id="x-forward-compat">
<template>
<style>
#container ::slotted(.foo) {
color: red;
}
#namedContainer ::slotted(*) {
border: 2px solid black;
}
</style>
<div id="namedContainer">
<slot name="named"></slot>
</div>
<div id="container">
<slot></slot>
</div>
</template>
</dom-module>
```

After runtime transform:
{.caption}

```html
<dom-module id="x-forward-compat">
<template>
<style>
#container ::content > .foo {
color: red;
}
#namedContainer ::content > * {
border: 2px solid black;
}
</style>
<div id="namedContainer">
<content select="[slot=named]"></content>
</div>
<div id="container">
<content></content>
</div>
</template>
</dom-module>
```

Note that Polymer doesn't transform code that _uses_ this element.
Anywhere you're using `x-forward-compat`, you'd have to change to the new slot syntax:

```
<x-forward-compat>
<h2 slot="named">I'm the named content</h2>
<span>This content goes to the default slot.</span>
</x-forward-compat>
```

For more details about transitioning to `<slot>`, see the
[2.0-preview README](https://github.com/Polymer/polymer/blob/2.0-preview/README.md#distribution).

### Alternatives for `:root` selector

Another Polymer 2.x change is removing the `:root` selector and replacing it with `html` in `<style is="custom-style">`, and `:host > *` in element styles.

This release allows for using both `html` and `:root` in `<style is="custom-style">`, and using both `:root` and `:host > *` in element styles

Bug fixes:

[#3676](https://github.com/Polymer/polymer/issues/3676). The `preserve-content` attribute does not protect style tags nested in templates.

[#3836](https://github.com/Polymer/polymer/issues/3836). `var()` functions rewritten incorrectly with `useNativeCSSProperties=true`.

[#3957](https://github.com/Polymer/polymer/issues/3957). VoiceOver/iOS: Anchors do not fire tap.

[#3965](https://github.com/Polymer/polymer/issues/3965). Performance regression on IE11.


## [Release 1.6.1](https://github.com/polymer/polymer/tree/v1.6.1) (2016-08-01) {#v-1-6-1}

New features:
Expand Down Expand Up @@ -60,7 +174,7 @@ Bug fixes:

- [#3779](https://github.com/Polymer/polymer/issues/3779).
When an attribute and a property are present at upgrade time,
the property should win.
the property should win.

- [#3677](https://github.com/Polymer/polymer/issues/3677).
Firing `value-changed` should not cause repeated value change on the
Expand Down

0 comments on commit 3f38a2d

Please sign in to comment.