Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
OK, there's a version of the renderer that uses LitElements. Some things that I still obviously need:
/cc @jacobsimionato |
jacobsimionato
left a comment
There was a problem hiding this comment.
This looks great to me. I'm in favor of merging this soon and then iterating.
renderers/lit/src/v0_9/catalogs/basic/components/AudioPlayer.ts
Outdated
Show resolved
Hide resolved
What about also deferring the markdown integration to later? Having this merged would mean that we can then make changes to the web core API without breaking your pending PR. |
Absolutely agree, the markdown integration should be super easy to add to the Text widget later. |
| render() { | ||
| if (!this.surface) return nothing; | ||
| if (!this._hasRoot) { | ||
| return html`<slot name="loading"><div>Loading surface...</div></slot>`; |
There was a problem hiding this comment.
Are we using the "loading" slot elsewhere? Why is this a slot, but the error isn't?
renderers/web_core/src/v0_9/basic_catalog/components/basic_components.ts
Show resolved
Hide resolved
…importing from v0_9 or v0_8.
This prevents the DOM of the app to look like:
```
<a2ui-surface>
<a2ui-node>
<a2ui-column>
<a2ui-node>
<a2ui-row>
<a2ui-node>
<a2ui-text>
...
```
Use the stricter types in web_core to allow "props" type to be inferred. This enables component programmers to have better type safety when accessing its component's controller.props (in the initial implementation this was always typed as "any")
Now that Elements are real LitElements and we don't need to carry over the ChildBuilder functions around, we can simplify the LitComponentImplementation to only hold what we care about of a Lit component: its tag name!
This is the model to make every other element a true LitElement: * Creates its own correctly typed controller (this allows strongly typed access to props) * Exports a correct element definition (with tagName) * Uses renderA2uiNode to render its children * Recreates the controller when the context changes
Each component is refactored as a LitElement, following the same changes that were done to the Tabs component.
This method is used to hide all the complexity of rendering child items in A2UI Lit elements from the catalog; it should make it much easier to end users to create their own.
…iNode method on the public API.
* Renamed catalog component files to match the class they contain. * Made the v0_9/index.ts export *explicitly* what we want to be part of the public API. * Updated catalog implementation with the latest imports, and format the files.
|
OK, this is it! PTAL @jacobsimionato, @ava-cassiopeia (anybody else who may want to look at this?) |
jacobsimionato
left a comment
There was a problem hiding this comment.
Looks great to me!
Description
Adds a Lit renderer for the v0.9 version of the protocol.
I cloned @jacobsimionato's #869 and polished it a little!
This iteration of the renderer is missing two big features compared to v0.8 (that will work on as fast-follows):
@a2ui/markdown-it)(And probably some proper formatting and better tooling).
Anyway, this should suffice as a starting point. Check out the
demo:gallery09Lit sample app to get this renderer to run. Other examples will be ported later.Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.