com-lihaoyi / os-lib

OS-Lib is a simple, flexible, high-performance Scala interface to common OS filesystem and subprocess APIs
Other
664 stars 61 forks source link

Include ScalaJS support #189

Closed DamianReeves closed 2 weeks ago

DamianReeves commented 1 year ago

So os-lib has always been cool, but now that it is a member of the Scala toolkit, the fact that the library doesn't support ScalaJS seems like a wart. It would be great of ScalaJS support could be added.

And yes, I know that many file and process things won't work in the browser but NodeJS and deno are out there.

lefou commented 1 year ago

Yeah. Scala.js support would be great. We gladly accept pull requests adding it.

DamianReeves commented 1 year ago

Yeah. Scala.js support would be great. We gladly accept pull requests adding it.

Is there a willingness to accept multiple PRs for this effort?

I would imagine, some parts may be fairly straightforward (i.e. Path related operations) and some others requiring different levels of effort. In my mind I see 3 main themes here: path, file I/O, and process support.

SethTisue commented 1 year ago

Is there a willingness to accept multiple PRs for this effort?

I hope so (commenting as an observer not participant) — as long as the first PR merged adds a Scala.js section to the documentation that's clear about what works or doesn't.

lefou commented 1 year ago

Yeah. Scala.js support would be great. We gladly accept pull requests adding it.

Is there a willingness to accept multiple PRs for this effort?

Of course. I thought, I said exactly that in the above quote.

I would imagine, some parts may be fairly straightforward (i.e. Path related operations) and some others requiring different levels of effort. In my mind I see 3 main themes here: path, file I/O, and process support.

That's fine as long as we document it. The PRs should be clear about their draft state, so that users know whether to expect stable or unstable Scala.JS API. Also some test coverage is required to maintain it.

lihaoyi commented 2 weeks ago

I think I'm going to call this a wontfix for now. The JS filesystem APIs are sufficiently different from JVM (e.g. being Async) that trying to unify them would be a whole research project on its own.

Users are still free to send PRs proposing possible implementations, but for now let's not track this as an active issue