feat(web_core, lit): implement createComponentImplementation and refactor basic catalog components - #2313
Open
josemontespg wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the createComponentImplementation helper function in @a2ui/web_core/v0_9 and refactors all basic catalog components to use it instead of manually defining their implementations. It also updates the Lit renderer to re-export this helper and refactors the corresponding test suite. A review comment points out a potential runtime TypeError in createComponentImplementation if apiOrImpl is null, since typeof null evaluates to 'object' and would crash on the 'tagName' in apiOrImpl check. A defensive guard is suggested to prevent this crash.
josemontespg
marked this pull request as draft
August 18, 2026 00:03
josemontespg
commented
Aug 18, 2026
josemontespg
force-pushed
the
lit-create-component-implementation
branch
2 times, most recently
from
August 18, 2026 00:28
b17e8be to
66c96b4
Compare
Collaborator
Author
|
All comments addressed:
|
josemontespg
commented
Aug 18, 2026
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 18, 2026 00:40
66c96b4 to
f8fe3b2
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 18, 2026 18:52
f8fe3b2 to
0f465b3
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 18, 2026 21:35
0f465b3 to
df457f9
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 03:14
df457f9 to
0fd7bdc
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 17:15
0fd7bdc to
3d186dd
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
2 times, most recently
from
August 19, 2026 19:17
06e0b06 to
d23d825
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 19:28
d23d825 to
d0e0239
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 21:00
f41ddb7 to
4408f8a
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 21:13
4408f8a to
f9917dd
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 21:59
f9917dd to
940ec8a
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 19, 2026 22:04
940ec8a to
8c1753f
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 17:09
8c1753f to
e25acad
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 17:58
e25acad to
87599e4
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 18:18
87599e4 to
341e7a0
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
2 times, most recently
from
August 20, 2026 19:31
9af5eb9 to
591a1ae
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 19:35
591a1ae to
7851410
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 19:39
7851410 to
8437fac
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 19:53
8437fac to
ef39574
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 19:58
ef39574 to
6b650a8
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 20:17
6b650a8 to
55936c1
Compare
josemontespg
force-pushed
the
lit-create-component-implementation
branch
from
August 20, 2026 20:26
55936c1 to
999c9b8
Compare
…ctor basic catalog components
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
This PR implements the
createComponentImplementationhelper function in@a2ui/web_core/v0_9and re-exports it in@a2ui/lit/v0_9. It also refactors all 18 basic Lit components inrenderers/web_core/src/v0_9/basic_catalog/components/to use this new pattern.Key Changes
@a2ui/web_core/v0_9: ImplementcreateComponentImplementationwhich pairs aComponentApidefinition, element constructor, and custom element tag name into aWebComponentImplementation.@a2ui/web_core/v0_9basic catalog components: RefactorAudioPlayer,Button,Card,CheckBox,ChoicePicker,Column,DateTimeInput,Divider,Icon,Image,List,Modal,Row,Slider,Tabs,Text,TextField, andVideoto export definitions usingcreateComponentImplementation.@a2ui/lit/v0_9: Re-exportcreateComponentImplementationfrom root index.web_core/src/v0_9/catalog/types.test.tsverifying pairing ofComponentApiwith tag names.Testing
yarn --cwd renderers/web_core test,yarn --cwd renderers/lit test)yarn --cwd renderers/lit/a2ui_explorer test:ci)yarn --cwd renderers/web_core lint,yarn --cwd renderers/lit lint,yarn --cwd renderers/lit/a2ui_explorer lint)