8000 Support java.io.BufferedWriter · Issue #5014 · scala-js/scala-js · GitHub
[go: up one dir, main page]

Skip to content

Support java.io.BufferedWriter #5014

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

Open
ThijsBroersen opened this issue Aug 16, 2024 · 2 comments
Open

Support java.io.BufferedWriter #5014

ThijsBroersen opened this issue Aug 16, 2024 · 2 comments
Labels
missing javalib Report of something from the JDK that is missing (does not link)

Comments

@ThijsBroersen
Copy link

While trying to cross-compile some zio-json code for supporting streaming json-lines, I ran into the issue that java.io.BufferedWriter was not implemented in Scala-js.
I was also cross-compiling to Scala-native and there the BufferedWriter class is implemented. I tried to use the same implementation for Scala-js and it turns out it just works out of the box. This is the implementation: https://github.com/scala-native/scala-native/blob/d5d65e755a4fb40a1c562d50b046384000232b23/javalib/src/main/scala/java/io/BufferedWriter.scala#L4

Can this be included in Scala-js?
I could make a PR with this single file and include e.g. this test: https://github.com/scala-native/scala-native/blob/d5d65e755a4fb40a1c562d50b046384000232b23/unit-tests/shared/src/test/scala/org/scalanative/testsuite/javalib/io/BufferedWriterTest.scala#L10
Anything else?

@gzm0 gzm0 added the missing javalib Report of something from the JDK that is missing (does not link) label Aug 16, 2024
@gzm0
Copy link
Contributor
gzm0 commented Aug 16, 2024

Typically, Scala.js has stricter code quality and testing requirements than Native. But maybe it's easiest if you open a PR and in the review process we address these? It's not like the API is so huge.

ThijsBroersen added a commit to ThijsBroersen/scala-js that referenced this issue Aug 16, 2024
Implementation copied from Scala-native
@ThijsBroersen
Copy link
Author

Created a PR: #5015

4FAB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing javalib Report of something from the JDK that is missing (does not link)
Projects
None yet
Development

No branches or pull requests

2 participants
0