You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As suggested by @devnook in web-platform-dx/baseline-status#35 (comment), could you please provide an SVG image and/or basic HTML/CSS (without JS) as alternative formats to JSON for web platform features? They could be used as static baseline status widgets where JS is not supported, e.g. <img src="https://api.webstatus.dev/v1/features/xxx?format=svg"> and/or <iframe src="https://api.webstatus.dev/v1/features/xxx?format=html"></iframe>.
Thank you!
The text was updated successfully, but these errors were encountered:
Thank you for the suggestion. Given that the /v1/features/{featureID} API provides a broad range of data beyond what's displayed in the widget, I believe generating SVG or HTML directly within the API service might lead to unnecessary complexity. This complexity arises from the fact that the API layer acts (and should continue to act) as a data provider, knowing nothing about the presentation layers, such as the webstatus.dev frontend or the baseline widget.
Instead, I propose we implement this rendering functionality within the separately hosted frontend service. Specifically, we could introduce an endpoint like webstatus.dev/features/anchor-positioning/widget?format=html. This endpoint would leverage the existing baseline-status widget from https://github.com/web-platform-dx/baseline-status for server-side rendering[1].
Given that the baseline-status widget is purely for displaying data and has no interactive elements, this server-side rendering approach will provide the static HTML output requested.
To achieve this, we may need some upstream changes to the baseline-status widget. Example: allowing it to accept a data property, thus bypassing its internal API fetch. This would enable server-side hydration. This approach prevents us from duplicating the widget's logic and ensures consistent rendering.
One benefit of this approach: It allows the webstatus.dev frontend or anyone in the community to host such a service
@jcscottiii That would be awesome to have a static HTML (no JS) baseline status widget. Injecting data object should be straightforward, but if it wasn't, as an alternative you could reuse the Astro Embed Baseline Status. Thank you!
As suggested by @devnook in web-platform-dx/baseline-status#35 (comment), could you please provide an SVG image and/or basic HTML/CSS (without JS) as alternative formats to JSON for web platform features? They could be used as static baseline status widgets where JS is not supported, e.g.
<img src="https://api.webstatus.dev/v1/features/xxx?format=svg">
and/or<iframe src="https://api.webstatus.dev/v1/features/xxx?format=html"></iframe>
.Thank you!
The text was updated successfully, but these errors were encountered: