Repository navigation
feat(web_core): add a Lit-free basic catalog v1 api entry - #4239
jpelaez-23blocks wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new entry point @a2ui/web_core/catalogs/basic/v1/api that exports the v1 basic catalog's component APIs, functions, and theme schema without including Lit custom elements. This allows environments running without a DOM, such as React Native, to import these APIs without failing due to the absence of HTMLElement. The changes include updates to package.json to expose the new path, a new api.ts file defining the exports, and a corresponding test suite in api.test.ts to verify DOM-free loading and correct exports. There are no review comments, and I have no feedback to provide.
ced45bd to
02db656
Compare
|
@googlebot I signed it! |
|
Hi @jpelaez-23blocks, thank you for raising this pr to fix the issue. Could you please sync with main to fix the CHANGELOG.md conflict, remove the Co-Authored-By line from your commit message, and make sure your GitHub username is added to your signed CLA so the CLA check passes? |
Renderers without a DOM (React Native) cannot import @a2ui/web_core/catalogs/basic/v1, because it re-exports the Lit custom elements and Lit's browser build extends HTMLElement on load. The new ./catalogs/basic/v1/api entry exports the component APIs, functions and theme schema only. Fixes a2ui-project#4238
02db656 to
72d1175
Compare
|
@Varun-S10 thanks. Done: rebased on main with the CHANGELOG conflict resolved, the Co-Authored-By line removed, and the CLA now lists my username (the check passes). Build and the new tests pass on current main. |
|
Hi @jpelaez-23blocks, thank you for updating the pr. We have verified the pr and it does resolve the issue. I will escalate this to the team to review. Thank you for your patience and understanding. |
|
From triage bot, analysis: For humansTL;DR Summary: Targeted issues: Suggestion:
Reply:
To adjust the analysis and apply its suggestion, open it in the hosted triage UI, or run in your a2ui checkout: tools/internal/triage/triage_ui.sh https://github.com/a2ui-project/a2ui/pull/4239For softwareThis analysis is auto-created to help humans to triage this item. Please, do not treat it as a team decision. |
|
From triage bot, ping: @Varun-S10 this PR from an out-of-team contributor has had no response from the team for 14 days. Please review it, or tell the author what is next. If nothing changes in 7 days, the PR gets |
Fixes #4238.
@a2ui/web_core/catalogs/basic/v1(and@a2ui/web_core/v1_0, which re-exports it) loads the basic catalog's Lit custom elements. With thebrowsercondition and no DOM, which is what React Native's Metro does, Lit's browser build fails on load withReferenceError: HTMLElement is not defined.This adds a
./catalogs/basic/v1/apientry that exports only what a renderer with no DOM needs: the component APIs (ButtonApi…VideoApi,BASIC_COMPONENTS,WeightSchema,BASIC_CATALOG_DOCUMENT_OPTIONS), the functions and function APIs, and the theme schema. It re-exports existing modules and moves nothing, so the current entries behave the same.Tests
api.test.tsimports the new entry in a child Node process with--conditions=browserand no DOM, and checks that it loads and exports the 18 component APIs and the functions. Pointing the same check at./index.jsfails with theHTMLElementerror, so the test catches a Lit import that comes back later.yarn buildintypescript/core/web_core, thennode --test "dist/**/*.test.js": 1629 pass, 0 fail.We found this while building a React Native renderer for A2UI pages (see #428). It uses
web_core'sNodeResolvertree with native views and has to import these modules fromsrc/paths today.🤖 Generated with Claude Code