Skip to content

bundle ng-basic-catalog as default out-of-the-box renderer#71

Merged
jgindin merged 1 commit into
mainfrom
fast-start
Jun 24, 2026
Merged

bundle ng-basic-catalog as default out-of-the-box renderer#71
jgindin merged 1 commit into
mainfrom
fast-start

Conversation

@jgindin

@jgindin jgindin commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Include the ng-basic-catalog sample in with the shell build so that you can be up & running immediately.

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

This Pull Request was closed. The preview environment at /pr/71/ has been fully decommissioned.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for relative renderer URLs (starting with '/') across the application, updating the configuration, settings validation, query parser, and preview bridge fetch calls accordingly. It also integrates dynamic initial draft pre-population based on the active catalog. The reviewer feedback highlights three main areas for improvement: addressing potential state desynchronization when switching active catalogs, using JSON.stringify instead of template string interpolation to construct JSON safely, and replacing corepack yarn with standard yarn in the package scripts for better portability and consistency.

Comment thread shell/src/app/chat/state-sync/state-sync.ts
Comment thread shell/src/app/chat/state-sync/state-sync.ts Outdated
Comment thread shell/package.json Outdated
@jgindin jgindin force-pushed the fast-start branch 4 times, most recently from 2d74a02 to 7826a66 Compare June 23, 2026 15:44
@jgindin jgindin requested a review from sugoi-yuzuru June 23, 2026 15:50
@jgindin jgindin force-pushed the fast-start branch 2 times, most recently from 428ed8e to e17b597 Compare June 23, 2026 19:58
@jgindin jgindin requested review from ditman and jacobsimionato June 24, 2026 13:35

@ditman ditman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we're symlinking the ng-basic-catalog dist to make it "look like a package" is a little bit iffy. Could it be a yarn workspace package instead? I don't think we'd need to publish it to npm, but at least the dependency in the shell app would be "workspace:*" or similar?

Comment thread shell/src/samples/ng-basic-catalog Outdated
@jgindin jgindin force-pushed the fast-start branch 2 times, most recently from 95465e1 to 78545c6 Compare June 24, 2026 17:47
@jgindin jgindin requested a review from ditman June 24, 2026 17:47

@ditman ditman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some more comments/questions, but I don't want to block you too much. Please address whatever you consider necessary (or create issues to improve later!)

Comment thread shell/src/app/settings/settings-view/settings.ts Outdated
Comment thread shell/src/app/shell/query-parser/query-parser.spec.ts
Comment thread shell/package.json
"angular-eslint": "22.0.0",
"eslint": "10.5.0",
"jsdom": "29.1.1",
"ng-basic-catalog": "0.1.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this dependency is needed, since we're globbing node_modules/ng-basic-catalog/dist/ng-basic-catalog/browser as assets above.

(Also, I don't understand how this'd resolve, since ng-basic-catalog is not a real package? I'm clearly missing some yarn sorcery here)

if (typeof window === 'undefined' || !window.fetch) return null;

let res = await this.fetchWithTimeout('/catalog');
let res = await this.fetchWithTimeout('catalog');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These URLs are now more sensitive to the way the iframe is deployed, for example, doing fetch('bar.json') yields different results when run in:

I guess this is acceptable, but it may be better to create a new URL for these resources that resolves against a more specific window.location base URL (similar to what was done below), or make a specific note about this deployment requirement in the manual of the preview bridge.

Comment thread samples/ng-basic-catalog/src/assets/catalog.json
Comment thread shell/src/app/chat/state-sync/state-sync.ts
Comment thread shell/src/app/settings/settings-view/settings.ng.html Outdated
- Update shell build options in angular.json to copy basic catalog
  assets from the locally resolved node_modules folder.
- Enforce topological order and exclude root workspace in root
  package.json scripts (build, test, prettier, clean, lint) to
  prevent execution loops.
- Reorder build steps in deploy workflows to build ng-basic-catalog
  before the shell.
- Set defaultRendererUrl in config.json to relative path.
- Add basic catalog workspace dependency to shell package.json for
  build ordering, and build catalog workspace on shell start.
- Configure ng-basic-catalog build with relative base href to support
  embedded frame loading.
- Resolve preview-bridge catalog endpoints relatively to support
  embedded paths.
- Relax settings page pattern validator and QueryParser URL parser to
  support relative paths.
- Add E2E and unit tests verifying relative URL resolution, validation,
  and initial workspace loading.
- Restrict CAR_BOOKING pre-population to when the renderer app
  supports the basic catalog.
- Update StateSync to dynamically detect catalog changes and reset the
  active draft if incompatible.
- Add unit tests for StateSync to cover dynamic draft resets on catalog
  change and verify parsing logic edge cases.

TAG=agy
BUG=
@jgindin jgindin merged commit e693224 into main Jun 24, 2026
13 checks passed
github-actions Bot added a commit that referenced this pull request Jun 24, 2026
@jgindin jgindin deleted the fast-start branch June 24, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants