Skip to content

Only load BridgeComponent controllers if the Hotwire Native user agent supports the component#5

Merged
jayohms merged 2 commits intomainfrom
should-load-change
Mar 12, 2025
Merged

Only load BridgeComponent controllers if the Hotwire Native user agent supports the component#5
jayohms merged 2 commits intomainfrom
should-load-change

Conversation

@jayohms
Copy link
Copy Markdown
Contributor

@jayohms jayohms commented Mar 12, 2025

Previously, a BridgeComponent controller would always load for any Hotwire Native client app. This has backwards-compatibility concerns depending on how the BridgeComponent code was written. BridgeComponent controllers should only load for an app that explicitly supports the component via its User-Agent.

With this change, BridgeComponent controllers will only load on a client app if the component is provided as a supported bridge-component in the User-Agent.

…nt supports the bridge component. This prevents unintended backwards incompatibility side effects for older clients that don't yet support a given bridge component.
@jayohms jayohms requested a review from olivaresf March 12, 2025 13:22
@jayohms jayohms changed the title Only load bridge component controllers if the Hotwire Native user agent supports the component Only load BridgeComponent controllers if the Hotwire Native user agent supports the component Mar 12, 2025
Comment thread src/helpers/user_agent.js Outdated
Comment thread src/helpers/user_agent.js
@jayohms jayohms merged commit b0f3e99 into main Mar 12, 2025
1 check passed
@jayohms jayohms deleted the should-load-change branch March 12, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants