-
Notifications
You must be signed in to change notification settings - Fork 2
react-native: replace AlternatingFileWriter with WritableStream and ChunkifierSink for breadcrumbs #315
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
Conversation
545f249
to
1ad7f87
Compare
packages/react-native/src/breadcrumbs/FileBreadcrumbsStorage.ts
Outdated
Show resolved
Hide resolved
public async write(data: W): Promise<void> { | ||
// If data is empty from the start, forward the write directly to current stream | ||
if (this.isEmpty(data)) { | ||
return await this.ensureStreamContext().streamWriter.write(data); |
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.
do we need to run a write operation at all? Based on the stream writer implementation, we don't need to?
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.
It's just that any write to this sink should end up in calling write on the underlying stream.
0872be8
to
414e2a9
Compare
This PR replaces
AlternatingFileWriter
withWritableStream
andChunkifierSink
based onchunkifier
from Node.As React Native does not have a
WritableStream
support by default, a ponyfill is used.