-
Notifications
You must be signed in to change notification settings - Fork 312
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
Drop forced eventsource
polyfill to opt-in to streaming support
#878
Conversation
Size Change: -1.56 MB (-14%) 👏 Total Size: 9.64 MB
|
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.
Let's merge it. beautiful idea.
src/horizon/call_builder.ts
Outdated
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 love it and strongly support!
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.
Lgtm! Haven't tested though. Would that be helpful before merging or are we confident in the change?
@tyvdh it'd be super helpful lol |
Get a different error. But still an error ✘ [ERROR] Could not resolve "https"
node_modules/.pnpm/github.com+stellar+js-stellar-sdk@29aaf8a11a17b34de65feeddd60f033125af22a9/node_modules/stellar-sdk/node_modules/eventsource/lib/eventsource.js:3:20:
3 │ var https = require('https')
╵ ~~~~~~~
The package "https" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
✘ [ERROR] Could not resolve "http"
node_modules/.pnpm/github.com+stellar+js-stellar-sdk@29aaf8a11a17b34de65feeddd60f033125af22a9/node_modules/stellar-sdk/node_modules/eventsource/lib/eventsource.js:4:19:
4 │ var http = require('http')
╵ ~~~~~~
The package "http" wasn't found on the file system but is built into node.
Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility. |
I'm using pnpm vs npm so not sure if or how they handle this service core:user:colorglyph-worker: Uncaught Error: Cannot find module 'eventsource'
at index.js:53676:28 in webpackMissingModule
at index.js:53679:18 in 6881
at index.js:75582:43 in __webpack_require__
at index.js:57323:61 in 8026
at index.js:75582:43 in __webpack_require__
at index.js:49844:59 in 5085
at index.js:75582:43 in __webpack_require__
at index.js:75656:37
at index.js:75658:11
at index.js:36374:26 in webpackUniversalModuleDefinition |
@Shaptic here's a boilerplate repo for testing on a CF worker |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
@tyvdh give it another shot! I think I got it 😎 |
89a6f39
to
65442da
Compare
Just confirming I have tested this and it's working fine. SHIP IT |
@tyvdh lol the warning works if |
Would love to see this branch updated and merged. I use it a lot and it's starting to fall behind |
c53a69e
to
ff2e9f1
Compare
Well 💩 |
The presence of the
eventsource
dependency is a problem for many deployment environments. It's also a polyfill that is non-essential for environments with native support for the EventSource API. Furthermore, not everyone needs streaming support.This PR drops this dependency from being installed by default and warns downstream about the implications if the API is not present.
Its presence is still necessary in
devDependencies
for running tests related to streaming. Downstream developers can avoid installing these by usingnpm i --production stellar-sdk
.