Skip to content

Conversation

@pawelblaszczyk5
Copy link

@pawelblaszczyk5 pawelblaszczyk5 commented Jan 18, 2026

Hello 👋

When liveSse mode got introduced, it included fetch-event-source which is used instead of built-in EventSource because of richer capabilities. However, it had a few assumptions (document/window existence) + bugs when it comes to aborting. This was patched, however, when building typescript-client patched version isn't included and when user uses it - they have unpatched version.

Screenshot from npm published code:

image

That results in all of these issues being present when consumer installs the library. For example, it's impossible to abort liveSse shapes, which someone spotted here #2322 (comment)

This makes the fetch-event-source library being inlined in the bundled code, with patched changes applied. Example output after my change (I marked some changes which are included in the patch):

image

Example from the local app I'm working on atm, without the patch - observe shape requests being aborted and then immediately started again

Screen.Recording.2026-01-18.at.14.45.54.mov

While if I used dist built from this branch:

Screen.Recording.2026-01-18.at.14.44.42.mov

That was a bit rough to debug, but I think I've got it right 😄

Summary by CodeRabbit

  • Bug Fixes

    • Ensured liveSse mode now includes the correct event-source support across builds so consumers receive the patched runtime behavior (fixes unpatched event handling and abort issues).
  • Documentation

    • Added a changeset entry documenting the patch and its impact on liveSse behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

Adds a changeset entry for a patch bump of @electric-sql/client and updates the TypeScript client's build config to include @microsoft/fetch-event-source in bundled outputs so the patched implementation is delivered to consumers.

Changes

Cohort / File(s) Summary
Build configuration
packages/typescript-client/tsup.config.ts
Added noExternal: [\@microsoft/fetch-event-source`]tocommonOptions, causing @microsoft/fetch-event-source` to be bundled into outputs (esm, cjs, legacy esm, browser).
Changeset documentation
.changeset/slow-apricots-clean.md
Adds a changeset noting a patch bump for @electric-sql/client and documents that liveSse previously relied on fetch-event-source (with assumptions/bugs around document/window and abort handling) which are intended to be included in the patched client build.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • KyleAMathews

Poem

🐰 I hopped through code to tuck it tight,
Fetch-event-source bundled snug and right,
No loose hops in browsers now, hooray—
Patch in place, I nibble worries away! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: bundling a patched version of fetch-event-source into the typescript-client package to fix runtime issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e462b78 and 7b29b8f.

📒 Files selected for processing (2)
  • .changeset/slow-apricots-clean.md
  • packages/typescript-client/tsup.config.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/slow-apricots-clean.md
  • packages/typescript-client/tsup.config.ts

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@electric-sql/react@3732
npm i https://pkg.pr.new/@electric-sql/client@3732
npm i https://pkg.pr.new/@electric-sql/y-electric@3732

commit: e462b78

@pawelblaszczyk5 pawelblaszczyk5 force-pushed the bundle-patched-dependency branch from e462b78 to 7b29b8f Compare January 23, 2026 07:52
@netlify
Copy link

netlify bot commented Jan 23, 2026

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 7b29b8f
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/697328b0fdd1c000081a7909
😎 Deploy Preview https://deploy-preview-3732--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pawelblaszczyk5
Copy link
Author

I spotted someone running actions here and it failing with some unrelated golang error during build - I rebased the branch to current main, hope it helps 😄 Can I do anything more to help it move forward? Are my findings correct here, or should I dig deeper? Thanks a lot in advance!

Copy link
Contributor

@balegas balegas left a comment

Choose a reason for hiding this comment

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

Hey, nice catch! Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants