Skip to content

closes #493 - Make designer and zpl extension usable from angular bun… - #494

Merged
jogibear9988 merged 1 commit into
masterfrom
feature/angularAdaptions
Sep 7, 2026
Merged

closes #493 - Make designer and zpl extension usable from angular bun…#494
jogibear9988 merged 1 commit into
masterfrom
feature/angularAdaptions

Conversation

@lschirmbrand

Copy link
Copy Markdown
Contributor

…dled projects

@jogibear9988
jogibear9988 merged commit 2e3256b into master Sep 7, 2026
1 check passed
@jogibear9988
jogibear9988 deleted the feature/angularAdaptions branch September 7, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are confirmed runtime-crash paths introduced by making the preview view optional (unguarded demoView calls) and a zplPackageUrl SSR/document-undefined URL construction edge case.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves runtime usability in bundled host apps (e.g., Angular/Bun) by making asset/base paths configurable (instead of relying on import.meta.url rewriting) and by allowing the preview tab to be disabled safely.

Changes:

  • Add configurable + fallback asset path resolution to core designer and Wunderbaum widgets (globalThis override + setAssetsPath).
  • Allow disabling the preview/demo view by making demoViewWidget nullable, and make disposal null-safe.
  • Add ZPL package base-path utilities and switch ZPL resources (fonts, element JSON) to resolve through them; export these constants.
  • Update package-lock.json (Blockly-related bumps and lockfile cleanup).
File summaries
File Description
packages/web-component-designer/src/elements/services/ServiceContainer.ts Makes demoViewWidget nullable to support removing the preview tab.
packages/web-component-designer/src/elements/documentContainer.ts Uses optional chaining when disposing code/demo views.
packages/web-component-designer/src/Constants.ts Adds robust assetsPath resolution with host overrides and fallback.
packages/web-component-designer-zpl/src/setupZplServiceContainer.ts Resolves widgets/elements.json via zplPackageUrl instead of import.meta.url.
packages/web-component-designer-zpl/src/index.ts Re-exports ZPL constants for host configuration.
packages/web-component-designer-zpl/src/fonts/zplFonts.ts Loads fonts via zplPackageUrl for bundler-friendly resolution.
packages/web-component-designer-zpl/src/Constants.ts Introduces configurable ZPL base path + URL helper.
packages/web-component-designer-widgets-wunderbaum/src/Constants.ts Adds robust assetsPath resolution with host overrides and fallback.
package-lock.json Lockfile updates for dependency versions and entries.
Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +37 to +40
export function zplPackageUrl(relativePath: string): URL {
const base = typeof document === 'undefined' ? undefined : document.baseURI;
return new URL(zplBasePath + relativePath, base);
}
Comment on lines +243 to +244
this.codeView?.dispose();
this.demoView?.dispose();
Comment on lines +14 to +16
const imporUrl = new URL((import.meta.url));
if (imporUrl.protocol === 'http:' || imporUrl.protocol === 'https:')
return imporUrl.origin + imporUrl.pathname.split('/').slice(0, -1).join('/') + '/../assets/';
Comment on lines +18 to +20
const imporUrl = new URL((import.meta.url));
if (imporUrl.protocol === 'http:' || imporUrl.protocol === 'https:')
return imporUrl.origin + imporUrl.pathname.split('/').slice(0, -1).join('/') + '/../assets/';
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.

3 participants