browser-or-node icon indicating copy to clipboard operation
browser-or-node copied to clipboard

feat: Add support for Bun

Open xeho91 opened this issue 2 years ago • 2 comments

Purpose

It supports another JavaScript runtime, a rising star - bun.

Shortly, I added a new variable, isBun, which detects if the Bun is defined and its property - version is defined. Of course, I've added it quickly to the documentation and tests. There's a separate file - ./test/bun.ts, which can be tested by running in the terminal:

bun run ./test/bun.ts

The documentation for the Bun global object is in progress. At the current moment, you can only verify by using Bun's REPL:

bun x bun-repl

xeho91 avatar Mar 09 '23 08:03 xeho91

How reliant is this check @xeho91? If the documentation for Bun global object is still in progress, should we wait to write a reliable check?

flexdinesh avatar Mar 09 '23 22:03 flexdinesh

How reliant is this check @xeho91? If the documentation for Bun global object is still in progress, should we wait to write a reliable check?

Sure, I am cool with waiting until the documentation for the Bun global object is present.👍 I doubt they would do any breaking changes in this object, but please do not take my word for it.

xeho91 avatar Mar 10 '23 04:03 xeho91

@flexdinesh

There is now a documented approach from Bun. @xeho91 pull request has done 90% of the work so its probably easier to just change this one than for me to create a new pull request.

@see https://bun.sh/guides/util/detect-bun const isBun = typeof process !== "undefined" && process.versions != null && process.versions.bun != null;

paradoxloop avatar Jan 25 '24 12:01 paradoxloop

@flexdinesh

There is now a documented approach from Bun. @xeho91 pull request has done 90% of the work so its probably easier to just change this one than for me to create a new pull request.

@see https://bun.sh/guides/util/detect-bun const isBun = typeof process !== "undefined" && process.versions != null && process.versions.bun != null;

Thanks, ~~I'll update today after work ASAP~~

EDIT: Updated via GitHub mobile 😅 https://github.com/flexdinesh/browser-or-node/commit/a7aaa970f3cf8d2ce94cc412d2fca761c7439ffd

xeho91 avatar Jan 26 '24 00:01 xeho91

Thanks @xeho91. Looking good. Could you remove the files in test dir? We got rid of all tests recently because they were not really testing anything. I'll merge and publish a new version as soon as it's done.

flexdinesh avatar Jan 27 '24 09:01 flexdinesh

Thanks @xeho91. Looking good. Could you remove the files in test dir? We got rid of all tests recently because they were not really testing anything. I'll merge and published a new version as soon as it's done.

Done. Thank you for your patience.

xeho91 avatar Feb 07 '24 08:02 xeho91

hi @flexdinesh giving this merge request a bump

paradoxloop avatar Apr 15 '24 12:04 paradoxloop

@paradoxloop good to merge. Looks like there are some conflicts. Once that's resolved, I'll merge and ship a new minor. Thanks for following this through.

flexdinesh avatar Apr 15 '24 23:04 flexdinesh

@paradoxloop good to merge. Looks like there are some conflicts. Once that's resolved, I'll merge and ship a new minor. Thanks for following this through.

Hi @flexdinesh,

I am slightly confused, where are the conflicts? image

xeho91 avatar Apr 16 '24 05:04 xeho91

Sorry I was on rebase view. My bad. Merged now. 😀

flexdinesh avatar Apr 18 '24 00:04 flexdinesh

Changes published in v3.0.0 🎉 Thanks everyone!

flexdinesh avatar Apr 18 '24 00:04 flexdinesh