js-stellar-sdk
                                
                                
                                
                                    js-stellar-sdk copied to clipboard
                            
                            
                            
                        Fixes the types related to event types.
Thanks to @CITGuru for reporting this! It closes #914 and #915.
Size Change: 0 B
Total Size: 11.4 MB
ℹ️ View Unchanged
| Filename | Size | 
|---|---|
dist/stellar-sdk.js | 
6.31 MB | 
dist/stellar-sdk.min.js | 
5.08 MB | 
@Shaptic great that helps. However, the EventSource static variable type declaration is not backward compatible. If you install this in Typescript less than 5, it throws the same error. Typescript changed from using number in older versions to using actual numbers in newer versions.
Ah, so this is a breaking change, then... :facepalm: did TypeScript break this across a minor version boundary, then??
But then doing something like number | 1 means downstream needs to handle the union :thinking: maybe I'll just include this in the next major version release? though that may not be for some time... this is obnoxious to say the least. What are your thoughts as a downstream user, @CITGuru? Is requiring TypeScript 5 unreasonable?
But then doing something like
number | 1means downstream needs to handle the union 🤔 maybe I'll just include this in the next major version release? though that may not be for some time... this is obnoxious to say the least. What are your thoughts as a downstream user, @CITGuru? Is requiring TypeScript 5 unreasonable?
Yes, this would affect downstream users and projects who have not yet upgraded to Typescript or just can't. I had to downgrade one of our projects back to Typescript 4 as I didn't have enough bandwidth to fix all the issues as it affected other libraries still using old Typescript.
Adding union to support number | 1 might work.
Hey @CITGuru just want to call out this note from the latest release (#918):
There will come a future major release in which we drop support for TypeScript 5 and other outdated tooling that will incorporate this change with enough warning to downstream systems.