withastro / roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
292 stars 29 forks source link

RFC: change injectScript's "page-ssr" stage behavior #293

Closed yassinedoghri closed 1 year ago

yassinedoghri commented 2 years ago

Summary

[integration API] The injected script during the page-ssr stage should be run on every page and behave exactly as the frontmatter code in astro pages.

This would allow for more powerful integrations and use cases + make the integration API easier to work with.

Links

natemoo-re commented 1 year ago

Hey @yassinedoghri, thanks for the proposal! Apologies that we haven't given this any direct feedback yet.

After chatting with the team, we understand that the current page-ssr hooks are limited for your particular use case. However, we have fundamental reservations about exposing the ability for integrations to inject invisible code in the same scope as user code.

For that reason, we're going to close this particular proposal. That being said, we'd love to work with you to expose the correct hooks to unblock your use case! If you'd like to open a new Stage 1 Proposal outlining your goals rather than a specific API, we'd love to continue this conversation there.

yassinedoghri commented 1 year ago

I understand, thanks for taking the time to check the RFC!