analyzer
, code_transformers
, and html
version constraints.0.2.x
.0.4.x
.^0.27.0
and update to the test package.<0.27.0
and fix up some tests.web_components
transformer in pub serve, 27.webcomponents-lite.js
version, which does not include shadow dom.<0.26.0
.link[rel="x-dart-test"]
tags from the test
package to the transformer.Copied DomProxyMixin
from custom_element_apigen
to this package and renamed it CustomElementProxyMixin
. This can be mixed into any class that is using the @CustomElementProxy
annotation and provides easy access to the underlying javascript element via the jsElement
getter. For instance the following is a simple example of a dart class that wraps a custom javascript element foo-element
with a method doFoo
and a property foo
.
@CustomElementProxy('foo-element') class FooElement extends HtmlElement with CustomElementProxyMixin { FooElement.created() : super.created(); void doFoo(int arg1) => jsElement.callMethod('doFoo', [arg1]); int get foo => jsElement['foo']; void set foo(int newFoo) { jsElement['foo'] = newFoo; } }
html5lib
package dependency to html
.initWebComponents
.Added initWebComponents
function which performs html import aware initialization of an application. This is done by crawling all imported documents for dart script tags and initializing them. Any applications using this package should switch to this method instead of calling run
from the initialize
package directly.
You may also now just export package:web_components/init.dart
to initialize your app, and then stick your startup code inside a method marked with @initMethod
, for instance:
library my_app; export 'package:web_components/init.dart'; @initMethod void startup() { // custom app code here. }
bindingStartDelimiters
option to the ImportInlinerTransformer
. Any urls which contain any of the supplied delimiters before the first /
will be left alone since they can't be reasoned about. If you want these urls to be treated as relative to the current path you should add a ./
in front.ScriptCompactorTransformer
now names its bootstrap file based on the entry point html file, instead of the original dart file. This is ensure it is the original package.document.head
.ImportCrawler
with support for pre-parsed initial documents. This allows it to work better with other transformers in the same step (you can pass in a modified document).@CustomElement
test in internet explorer.initialize
lower bound to get bug fixes.path.url
in transformers.CustomElement
annotation. This can be added to any class to register it with a tag in the main document.web_components.dart
file which exports all the annotations provided by this package. Note that in later breaking releases html_import_annotation.dart
and custom_element_proxy.dart
will likely move into the src
folder, so switching to the web_components.dart
import is recommended.generateWebComponentsBootstrap
method to the main web_components
transformer file which accepts a Transform
and a Resolver
. You can use this function from any transformer and share the resolver you already have.ScriptCompactor
to not use =>
syntax since it has a declared return type of void
. This could previously cause a checked mode error if the original program returned something from main
.Added the HtmlImport
annotation. This can be added to any library declaration and it will inject an html import to the specified path into the head of the current document, which allows dart files to declare their html dependencies. Paths can be relative to the current dart file or they can be in package:
form.
Note: Html imports included this way cannot contain dart script tags. The mirror based implementation injects the imports dynamically and dart script tags are not allowed to be injected in that way.
Note: Relative urls cannot be used in inlined script tags. Either move the script code to a Dart file, use a package:
url, or use a normal HTML import. See https://github.com/dart-lang/web-components/issues/6.
Added a web_components
transformer. This should be used in place of the initialize
transformer if that already exists in your application (it will call that transformer). This will inline html imports (including @HtmlImport annotations) into the head of your document at compile time, it can be used like this:
transformers: - web_components: entry_points: - web/index.html
If no entry_points
option is supplied then any html file under web
or test
will be treated as an entry point.
CustomElementProxy
annotation. This can be added to any class which proxies a javascript custom element and is the equivalent of calling registerDartType
. In order to use this you will need to be using the initialize
package, and call its run
method from your main function. It is also recommended that you include the transformer from that package to remove the use of mirrors at runtime, see initialize for more information.0.5.1
js version.platform.js
has been replaced with webcomponents.js
. Also, the default file is now unminified, and the minified version is called webcomponents.min.js
..map
and .concat.js
files during release mode.Updated to platform version 0.4.2, internally a deprecated API was removed, hence the bump in the version number.
split dart_support.js in two. dart_support.js only contains what is necessary in order to use platform.js, interop_support.js/interop_support.html can be imported separately when providing Dart APIs for js custom elements.
node
. There is no longer a single global observer, but one for each ShadowRoot and one for the main document. The observer that is actually used defaults to the main document, but if node
is supplied then it will walk up the document tree and use the first observer that it finds.registerDartType
and updates to platform 0.3.3-29065bc (re-applies the changes in 0.3.5).registerDartType
to register a Dart API for a custom-element written in Javascript.