Skip to content
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: add experimentalDisableStreaming to react integration (#1) #13036

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

artmsilva
Copy link

@artmsilva artmsilva commented Jan 21, 2025

Changes

This pull request introduces a new feature to the React integration by adding an option to disable streaming support. This feature aims to support libraries that are not compatible with streaming, such as Stitches.js. The most important changes include updates to the configuration options and rendering logic.

Testing

Docs

* feat: add experimentalDisableStreaming to react integration

* chore: commit save point

* chore: commit save point
Copy link

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: f946f07

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

@github-actions github-actions bot added pkg: react Related to React (scope) pkg: integration Related to any renderer integration (scope) labels Jan 21, 2025
@artmsilva artmsilva marked this pull request as ready for review January 21, 2025 20:00
@matthewp
Copy link
Contributor

Conceptually this makes sense as an option, and needed for most CSS-in-JS usage.

artmsilva and others added 2 commits January 21, 2025 16:43
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think this is a useful addition. I've just added a few comments and suggestions.

@@ -0,0 +1,5 @@
---
"@astrojs/react": patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a feature, so would be a minor

"@astrojs/react": patch
---

feat: add experimentalDisableStreaming to react integration (#1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
feat: add experimentalDisableStreaming to react integration (#1)
Add support for disabling streaming in React integration

Copy link
Member

@florian-lefebvre florian-lefebvre Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
feat: add experimentalDisableStreaming to react integration (#1)
Adds experimental support for disabling streaming

It would be nice to also show a code snippet. This will require a docs PR as well

@@ -14,6 +14,10 @@ export type ReactIntegrationOptions = Pick<
'include' | 'exclude' | 'babel'
> & {
experimentalReactChildren?: boolean;
/**
* Disable streaming support for React components in order to support libraries that are not compatible with streaming like Stitches.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Disable streaming support for React components in order to support libraries that are not compatible with streaming like Stitches.js
* Disable streaming in React components

Comment on lines +33 to +36
function optionsPlugin(
experimentalReactChildren: boolean,
experimentalDisableStreaming: boolean
): vite.Plugin {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we're adding more options it's probably best to make this an options object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: react Related to React (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants