-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Refactor] TabsComponent to CodeComponent custom element #969
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
[Refactor] TabsComponent to CodeComponent custom element #969
Conversation
6aa23e1
to
a7cf8f0
Compare
With this PR we could also completely remove ## Here is some code
<code-element>
<slot name=“js”>
console.log(“Hello World”)
</slot>
...
</code-element> Up to you if you want to keep it :) |
Perhaps, I'm missing the point. Why do we want to use a custom element in this app? |
With #549 we want to remove all the Since we dynamically append the content with This PR does not bring any value right now, apart from enabling #549. I try to simplify #549, so it is simpler to review. |
Makes sense now @BrunnerLivio! Thanks for the explanation. I'll review it shortly |
a7cf8f0
to
1f7cf9e
Compare
@kamilmysliwiec any plans to revisit this PR sometime soon? |
Since we are using differential loading + AOT, we need to add CUSTOM_ELEMENTS_SCHEMA to every lazily loaded module
1f7cf9e
to
da50f64
Compare
@kamilmysliwiec passive-aggressive bump #2 :) |
Finally found some time :) Apologies for the delay! Great contribution! |
@BrunnerLivio after merging this PR, I've noticed that some examples are missing. https://docs.nestjs.com/techniques/validation#transform-payload-objects See the missing code snippet below the EDIT: Another missing example: #1183 Let me temporarily revert this PR until we figure out what this issue is about #1184 |
@kamilmysliwiec alright let me look into it. Thanks for reverting it real quick! |
Thanks @BrunnerLivio 🔥 💪 |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
In the future, the HTML shall be appended to the DOM dynamically (pre-compile Markdown to HTML using Dgeni, dynamically request the HTML page). The
TabsComponent
is an Angular component - and the easiest way to say to Angular "hey, in this HTML I dynamically loaded is a component", is to simply convert the Angular component to a Custom Element / Webcomponent. Angular.io uses the same technique.Related Issue Number: #549
What is the new behavior?
Simplified the interface of the code/switcher component & converted it to a custom element.
Does this PR introduce a breaking change?
Other information
The
[appAnchor]
directive will need to be converted to a native element to enable #549. This will be done in a follow-up PR.