feat(@astrojs/react): export renderer for easy loading#11234
Merged
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 |
ematipico
commented
Jun 11, 2024
Member
Author
There was a problem hiding this comment.
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
matthewp
reviewed
Jun 11, 2024
Member
Author
|
!preview experimental-container |
Contributor
|
Snapshots have been released for the following packages:
Publish LogBuild Log |
matthewp
approved these changes
Jun 13, 2024
Contributor
matthewp
left a comment
There was a problem hiding this comment.
like this new approach.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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