Skip to content

fix: ensure exported WebComponent adds absolute links to document.css - #21124

Merged
mshabarov merged 1 commit into
mainfrom
issues/21120-embedded_component_absolut_css_url
Mar 17, 2025
Merged

mshabarov merged 1 commit into
mainfrom
issues/21120-embedded_component_absolut_css_url

Conversation

@mcollovati

Copy link
Copy Markdown
Collaborator

When using a development bundle, WebComponentBootstrapHandler adds a tag to the embedding document that references document.css for all used themes (application and parents). However, the URL is relative to the embedding document instead of being an absolute URL to the CSS resource. Additionally, the tag is added even if the theme does not provide a document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

1 170 files  ± 0  1 170 suites  ±0   1h 14m 14s ⏱️ -9s
7 785 tests ± 0  7 728 ✅ ± 0  57 💤 ±0  0 ❌ ±0 
8 130 runs   - 14  8 065 ✅  - 13  65 💤  - 1  0 ❌ ±0 

Results for commit f20d8a7. ± Comparison against base commit b1750a4.

@mshabarov
mshabarov merged commit c880995 into main Mar 17, 2025
@mshabarov
mshabarov deleted the issues/21120-embedded_component_absolut_css_url branch March 17, 2025 07:16
vaadin-bot pushed a commit that referenced this pull request Mar 17, 2025
…#21124)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620
vaadin-bot pushed a commit that referenced this pull request Mar 17, 2025
…#21124)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620
vaadin-bot pushed a commit that referenced this pull request Mar 17, 2025
…#21124)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620
vaadin-bot added a commit that referenced this pull request Mar 17, 2025
…#21124) (#21129)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620

Co-authored-by: Marco Collovati <marco@vaadin.com>
vaadin-bot added a commit that referenced this pull request Mar 17, 2025
…#21124) (#21128)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620

Co-authored-by: Marco Collovati <marco@vaadin.com>
vaadin-bot added a commit that referenced this pull request Mar 17, 2025
…#21124) (#21127)

When using a development bundle, WebComponentBootstrapHandler adds a <link>
tag to the embedding document that references document.css for all used
themes (application and parents). However, the URL is relative to the embedding
document instead of being an absolute URL to the CSS resource.
Additionally, the <link> tag is added even if the theme does not provide a
document.css file, potentially causing 404 errors at runtime.

This change ensures that the link URL is calculated based on the request and
that it only adds tags for existing CSS files.

Fixes #21120
Fixes #19620

Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.8.0.alpha2 and is also targeting the upcoming stable 24.8.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants