Skip to content

Commit

Permalink
Initial implementation of element merge strategy
Browse files Browse the repository at this point in the history
This commit supports attribute merging in component invocations by
storing the attribute operations for an element in
GroupedElementOperations. In `CloseElementOpcode`, we merge all of the
seen operations and execute them.

In principle, this work is only needed for component elements, which can
have multiple sources of attributes with arbitrary merge strategies.
This commit adds the GroupedElementOperations to every element, which
mildly regresses performance.

We plan to limit the impact to component elements, and have plans to
avoid the work in all but the most dynamic scenarios. That said, this
works and passes a new somewhat aggressive smoke test based on one that
helped us understand the nature of the problem in Glimmer 1.

Near-term work:

* Avoid GroupedElementOperations for regular elements
* Avoid emitting UpdatingOpcodes for static attributes on components
* Extract merge strategy into ComponentManager (and possibly allow
  kinds of attributes to control their own merging directly)
* Correctly group the operations so that invoker and invokee attributes
  can be properly interpreted by the merging logic.
  • Loading branch information
Godhuda committed Jan 22, 2016
1 parent 1cb81ac commit 07069c6
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 219 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/node_modules/glimmer-runtime/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 78 additions & 54 deletions packages/node_modules/glimmer-runtime/lib/builder.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07069c6

Please sign in to comment.