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(au-compose): ability to compose string as element name #1913

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

bigopon
Copy link
Member

@bigopon bigopon commented Feb 27, 2024

📖 Description

Adds the ability to understand string as element name to <au-compose/>, it'll throw in case of the name doesn't result in a registered element. All the following usages of <au-compose> will yield the same result:

<au-compose component.bind="el" style="width: 20%;" v="aurelia"></au-compose>
<au-compose component="my-el" style="width: 20%;" v="aurelia"></au-compose>

For component classes:

class MyApp {
  el = MyEl
}

class MyEl {
  @bindable v
}

just as the direct usage of <my-el>:

<my-el style="width: 20%;" v="aurelia"></my-el>
  • When composing directly with a custom element constructor, the constructor does not need to be a dependency of the element that owns <au-compose>
  • When composing with a custom element name, there must be either a locally or globally registered a custom element with the same name

Closes #1806

cc @fkleuver @Sayan751 @ekzobrain

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.37%. Comparing base (3c74be9) to head (a8c622c).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1913      +/-   ##
==========================================
- Coverage   88.37%   88.37%   -0.01%     
==========================================
  Files         260      260              
  Lines       22856    22847       -9     
  Branches     5299     5300       +1     
==========================================
- Hits        20198    20190       -8     
+ Misses       2658     2657       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bigopon bigopon merged commit 06aa113 into master Feb 27, 2024
28 checks passed
@bigopon bigopon deleted the feat/compose-el-name branch February 27, 2024 04:42
AureliaEffect pushed a commit that referenced this pull request Mar 2, 2024
2.0.0-beta.12 (2024-03-02)

**BREAKING CHANGE:**

* **enhance:** call app tasks with `.enhance` API, return app root instead of controller (#1916) ([4d522b2](4d522b2))
* **au-compose:** always create host for non custom element composition (#1906) ([8a28e0a](8a28e0a))

**Features:**

* **au-compose:** ability to compose string as element name (#1913) ([06aa113](06aa113))

**Bug Fixes:**

* **router:** prevent multiple navigation at the same time (#1895) ([deed11e](deed11e))
* **router:** properly handle false in conditional router hooks (#1900) ([a671463](a671463))
* **di:** dont jit register resources ([8ffde34](8ffde34))
* **di:** new instance resolver (#1909) ([efe208c](efe208c))
* **runtime:** tweak typings of injectable token ([89f76eb](89f76eb))

**Refactorings:**

* **runtime:** delay overriding array prototypes (#1914) ([d8be144](d8be144))
* **router:** use resolve ([89f76eb](89f76eb))
* **runtime:** better type inferrence for injectable token ([89f76eb](89f76eb))
* **di:** simplify container has, cleanup router ([89f76eb](89f76eb))

**Docs:**

* **docs:** add JS examples using resolve for IHttpClient (#1907) ([d57c1f1](d57c1f1))
* **doc:** remove define hook from documentation (#1903) ([f684141](f684141))
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.

templating engine drops attributes from au-compose tag
1 participant