Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compose): passthrough bindings + support containerless #1792

Merged
merged 7 commits into from Jul 10, 2023

Conversation

bigopon
Copy link
Member

@bigopon bigopon commented Jul 8, 2023

📖 Description

At the moment, <au-compose/> does not "pass through" bindings declared on the <au-compose> element. This creates undesirable workaround and sometimes, limitation. This is also a frequently requested feature of v1. This PR adds the ability to pass through all bindings declared on <au-compose/> to the composed custom element, so that it is as if the bindings, even bindable properties, were declared on the custom element itself.

  • Also enable containerless custom element composition. At the moment, an attempt of compositing a containerless custom element as component for the <au-compose/> will throw. Remove this constraint and containerless composition will just work as normal. This effectively make <au-compose/> as natural as a normal custom element usage, except it's more dynamic.

cc @Sayan751 @fkleuver

Resolves #497

@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Merging #1792 (a6211fb) into master (2486b58) will increase coverage by 0.02%.
The diff coverage is 91.46%.

❗ Current head a6211fb differs from pull request most recent head 4073c90. Consider uploading reports for the commit 4073c90 to get more accurate results

@@            Coverage Diff             @@
##           master    #1792      +/-   ##
==========================================
+ Coverage   88.43%   88.45%   +0.02%     
==========================================
  Files         245      247       +2     
  Lines       22335    22360      +25     
  Branches     5191     5199       +8     
==========================================
+ Hits        19751    19778      +27     
+ Misses       2584     2582       -2     
Impacted Files Coverage Δ
packages/runtime-html/src/errors.ts 100.00% <ø> (ø)
packages/runtime-html/src/templating/controller.ts 89.80% <ø> (ø)
...ackages/runtime-html/src/binding/spread-binding.ts 83.60% <83.60%> (ø)
...e-html/src/resources/custom-elements/au-compose.ts 91.62% <93.87%> (-0.60%) ⬇️
...ckages/runtime-html/src/binding/content-binding.ts 94.31% <94.31%> (ø)
.../runtime-html/src/binding/interpolation-binding.ts 93.91% <100.00%> (+1.30%) ⬆️
...ges/runtime-html/src/compiler/template-compiler.ts 97.78% <100.00%> (ø)
packages/runtime-html/src/renderer.ts 89.18% <100.00%> (+0.89%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bigopon bigopon changed the title feat(compose): passthrough bindings WIP feat(compose): passthrough bindings Jul 10, 2023
@bigopon bigopon changed the title feat(compose): passthrough bindings feat(compose): passthrough bindings + support containerless Jul 10, 2023
Copy link
Member

@Vheissu Vheissu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome to me. I made a few brief suggestions for the docs. Nothing overly dramatic!

Co-authored-by: Dwayne Charrington <dwaynecharrington@gmail.com>
@bigopon bigopon merged commit e8e39a9 into master Jul 10, 2023
5 of 6 checks passed
@bigopon bigopon deleted the feat/compose-passthrough branch July 10, 2023 10:49
AureliaEffect pushed a commit that referenced this pull request Jul 24, 2023
**Features:**

* **compose:** passthrough bindings + support containerless (#1792) ([e8e39a9](e8e39a9))
* **template:** access global (#1790) ([2486b58](2486b58))

**Bug Fixes:**

* **router-lite:** handling slash in parameter value (#1805) ([3fbb698](3fbb698))
* **au-slot:** correctly prepare resources for slotted view (#1802) ([bf1ca4c](bf1ca4c))
* **router-lite:** e2e build ([a1ca36d](a1ca36d))

**Refactorings:**

* **ref:** deprecate view-model.ref and introduce component.ref (#1803) ([97e8dad](97e8dad))
* **text-binding:** always evaluate expressions in strict mode (#1801) ([15acfee](15acfee))
* **router-lite:** query in fragment when using useUrlFragmentHash option (#1794) ([a1ca36d](a1ca36d))
* ***:** bindable property -> name (#1783) ([ca0eda7](ca0eda7))
* **router-lite:** optimize object creation (#1782) ([c1ef0a3](c1ef0a3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

au-compose should pass through bindings and content
2 participants