Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: sky/specs/modules.md

Issue 944873007: Specs: define how importing element registrations works, move built-in elements to a separate modul… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/specs/gestures.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/modules.md
diff --git a/sky/specs/modules.md b/sky/specs/modules.md
index 475ef9461a623b7debf98205e7515c8861c52882..13c8ebb26b61783efd124df460d2f96a6def0555 100644
--- a/sky/specs/modules.md
+++ b/sky/specs/modules.md
@@ -31,21 +31,36 @@ imported module:
<import src="path/to/chocolate.sky" as="chocolate" />
```
+Each module implicitly imports the [Built-In Elements
+Module](builtins.md).
+
+When a module imports another, and the ``import`` element has no
+``as`` attribute, then any elements registered in that module whose
+tag names do not begin with an underscore must be registered on the
+importing module. (If multiple elements are registered with the same
+name, that name gets marked as dead for that module and all the
+registrations for that name are discarded.)
+
+TODO(ianh): decide if elements imported with "as" should be imported
+but with the "as" name prefixed, as in ``<foo.button>``
+
Module API
----------
Each module consists of one or more libraries. The first library in a
-module is the *element tree library*, which imports the dart:sky
-module and then consists of the following code for a Sky module:
+module is the *element tree library*, which consists of the following
+code for a Sky module:
```dart
+import 'dart:sky';
final Module module = new Module();
```
...and the following code for a Sky application:
```dart
+import 'dart:sky';
final Module module = new Application();
```
« no previous file with comments | « sky/specs/gestures.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698