Draft
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
…importing from v0_9 or v0_8.
* Modify ComponentApi so it is generic over the type of its Schema. This generic is inferred later and not explicitly passed in when creating ComponentApis. * Add an InferredComponentApiSchemaType helper type to "infer" the type of the "schema" property of a ComponentApi. * Modify the basic catalog ComponentAPIs so they "satisfies ComponentApi" (instead of implementing it), so the type of the schema is not erased by the compiler, and can be accessed later. This is used so we can have "strongly-typed" props without defining a specific interface for the schema of each ComponentApi.
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.
Collaborator
Author
|
OK, there's a version of the renderer that uses LitElements. Some things that I still obviously need:
/cc @jacobsimionato |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I cloned @jacobsimionato's #869 and got it to work on my machine. This is the start of the v0.9 Lit renderer.
Next steps:
demo:gallery09sample app).Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.