-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(@astrojs/react): export renderer for easy loading #11234
Conversation
🦋 Changeset detectedLatest commit: 3d87d08 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to create a runtime.js
entry point, and re-export these values, but rollup has some issues with it. For the time being, this works
!preview experimental-container |
Snapshots have been released for the following packages:
Publish Log
Build Log
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this new approach.
Changes
It addresses #11181
The PR adds a new function called
addServerRenderer
. This function accepts a name and a server renderer object. Usually, the server renderer object is exposed by and entrypoint called*/server.js
. This is a pattern used by all our renderers.Ideally, we could remove the first argument of the function - which is the name - and expose is it from the renderer itself:
export default { + name: "@astrojs/react`, check, renderToStaticMarkup, supportsAstroStaticSlot: true, };
If this suggestion is accepted, I will make a second PR to change all the renderers we maintain.
Testing
Created a new test case
Docs
N/A
I will update docs later once we agreed in this API