Polymer Hybrid
There are several breaking changes when upgrading from 1.0 to 2.0:
iron-lazy-page
has been removed.
There are two reasons for this. First of all type extension is not supported by all major browsers.
It is therefore not possible to rely on <template is="...">
extensions.
Secondly, upgrading from iron-pages
to iron-lazy-pages
was quite intrusive
and the template syntax was confusing to users.
To upgrade, see the following example of before and after:
Before
<iron-lazy-pages attr-for-selected="data-route">
<template is="iron-lazy-page" data-route="foo" path="foo.html">
Foo page
</template>
<template is="iron-lazy-page" data-route="bar" path="bar.html">
<bar-page></bar-page>
</template>
</iron-lazy-pages>
After
<iron-lazy-pages attr-for-selected="data-route">
<span data-route="foo" data-path="foo.html">Foo</span>
<bar-page data-route="bar" data-path="bar.html"></bar-page>
</iron-lazy-pages>
As you can see, the templates are removed. Instead of path
on iron-lazy-pages
,
every page must now set data-path
instead. This also removes compatibility for
plain text nodes (e.g. previously you could add plain text in a iron-lazy-page
).
You must wrap the text in a <span>
or <div>
to once again display.
Paths are resolved relative to the parent of iron-lazy-pages
Given the following project structure:
src
|-- pages-user.html
|-- lazy-loaded.html
In 1.0 path="src/lazy-loaded.html"
. This has been changed to data-path="lazy-loaded.html"
. This is more logical from a usage perspective and also allows iron-lazy-pages
to be used in reusable components where the absolute URL is not known for all applications.
Note: this works if iron-lazy-pages
is a direct child of a custom element.
neon-lazy-pages
has been removed
neon-animation
has been deprecated and the maintenance burden of this element was too impactful for iron-lazy-pages
. Moreover, numerous issues were raised regarding animation timing, animation inconsistency and therefore not living up to the expectations of developers. Thus I decided to remove the element, as it was not serving the purpose that it should have been and maintaining would be too costly for me.