X Tutup
Skip to content

Create DOM adapter so that compiler can execute outside the browser #503

@mhevery

Description

@mhevery

The compiler relies on the browser to parse the HTML into DOM. It than walks the DOM to detect the directives, expressions, and statements. In order to be able to run the compiler outside the browser we need to refactor the code to remove the DOM dependency. This should be pretty straight forward, since the compiler already uses a facade to talk to DOM (since JS and Dart APIs are different)

Work needed:

  1. HTML Parser which would crete a tree. (This is performed by browser HTML parser) The tree does not have to be DOM.
  2. Create facade for the tree model created in step 1, which allows the compiler to walk the tree.
  3. Remove all cyclic dependencies

Compiler operations are limited to:

  1. reading element name
  2. reading attributes
  3. reading text nodes
  4. walking the tree using .firstChild and .nextSibling
  5. removing and re-wrapping subtrees into <template> tags.

Once the above work is completed the compiler will be able to execute outside the browser environment.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup