If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Currently, when writing Astro integrations that use the addRenderer API of 'astro:config:setup', a quite misleading log message is printed with every re-render of any component that uses the custom renderer.
The actual functionality however, works flawlessly, questioning the point of the log message warning.
Why is the log message misleading?
When Astro welcomes third party developers to use the addRenderer API to add custom renderers, and custom renderers work well, both in SSR and client mode, because they are very well recognized by their custom name,
then why would a log warning message like this make sense anymore?
Please don't be confused: In the reproduction example on CodeSandbox the issue still occurs because the dependency is pinned on the latest released astro version. When you check out my PR locally and run it with the command pnpm --filter @example/framework-custom run dev as developers are supposed to do, pnpm actually makes sure that my changed code with the fix is used and the misleading log message is already gone.
What's the expected result?
No warning log messages for custom renderers that clearly work and are recognized :)
Note for people arriving late to the show (people from the future): Moved the example code for a custom renderer / custom frontend framework integration over here: https://github.com/kyr0/astro-custom-renderer
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Currently, when writing Astro integrations that use the
addRenderer
API of'astro:config:setup'
, a quite misleading log message is printed with every re-render of any component that uses the custom renderer.https://github.com/withastro/astro/blob/25baa4ed0c5f55fa85c2c7e2c15848937ed1dc9b/packages/astro/src/runtime/server/render/component.ts#L269
In my reproduction example you will find the log messages (after opening the console) despite the rendering working:
This is, because the "recognized" renderers are hardcoded: https://github.com/withastro/astro/blob/25baa4ed0c5f55fa85c2c7e2c15848937ed1dc9b/packages/astro/src/runtime/server/render/component.ts#L35
The actual functionality however, works flawlessly, questioning the point of the log message warning.
Why is the log message misleading? When Astro welcomes third party developers to use the
addRenderer
API to add custom renderers, and custom renderers work well, both in SSR and client mode, because they are very well recognized by their custom name, then why would a log warning message like this make sense anymore?I fixed this in the following PR: https://github.com/withastro/astro/pull/12461
Please don't be confused: In the reproduction example on CodeSandbox the issue still occurs because the dependency is pinned on the latest released
astro
version. When you check out my PR locally and run it with the commandpnpm --filter @example/framework-custom run dev
as developers are supposed to do,pnpm
actually makes sure that my changed code with the fix is used and the misleading log message is already gone.What's the expected result?
No warning log messages for custom renderers that clearly work and are recognized :)
Link to Minimal Reproducible Example
https://codesandbox.io/p/devbox/github/kyr0/astro/tree/fix/custom-renderer-warning/examples/framework-custom
Participation