Skip to content
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

fix(unstable): Honor granular unstable flags in js runtime #21466

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

jcayzac
Copy link
Contributor

@jcayzac jcayzac commented Dec 5, 2023

This fixes #21434 for BroadcastChannel and WebSocketStream. --unstable still enable both, but granular unstable flags now also work:

  • --unstable-net now enables WebSocketStream.
  • --unstable-broadcast-channel now enables BroadcastChannel.
  • Additionally, there are now tests for all granular unstable flags. Since unsafe-proto already had tests, so I didn't add any for this one.

It also introduces a map to keep track of granular unstable ids without having to sync multiple places.

  • Ensure there are tests that cover the changes.
  • Ensure cargo test passes.
  • Ensure ./tools/format.js passes without changing files.
  • Ensure ./tools/lint.js passes.

Sorry, something went wrong.

@CLAassistant
Copy link

CLAassistant commented Dec 5, 2023

CLA assistant check
All committers have signed the CLA.

@jcayzac jcayzac marked this pull request as ready for review December 6, 2023 11:34
@jcayzac
Copy link
Contributor Author

jcayzac commented Dec 6, 2023

@bartlomieju @crowlKats what do you think of https://github.com/jcayzac/deno/pull/1/files ? Should I add it to this PR?

@bartlomieju
Copy link
Member

@bartlomieju @crowlKats what do you think of https://github.com/jcayzac/deno/pull/1/files ? Should I add it to this PR?

That seems okay, but please put contents of 89_granular_flags.js into 90_deno_ns.js directly.

@bartlomieju
Copy link
Member

Awesome work @jcayzac. Unfortunately we got some merge conflicts - would you be able to resolve them?

Also it would be great to add a regression test for this problem - maybe you could add a test to cli/tests/integration/run_tests.rs using itest! macro that adds all granular unstable flags, run a JavaScript file that console.log() various APIs that should be only available with these flags (eg. BroadcastChannel, WebSocketStream, Deno.openKv).

@jcayzac jcayzac changed the title fix(runtime): Honor granular unstable flags in js runtime fix(unstable): Honor granular unstable flags in js runtime Dec 6, 2023
@bartlomieju
Copy link
Member

Unfortunately I'm still unable to have passing tests even in main on either of my two machines (Intel MBP and AMD PC), so I'll have to rely on CI to tell me if they pass there.

Sorry to hear that, is it because of too much load? FWIW you don't need to run all the tests - you can do cargo run <test_name> to run a single test (or multiple if the name matches) and it should be good enough for this PR 👍 the blast radius of this problem is rather small.

@jcayzac jcayzac force-pushed the fix/21434 branch 12 times, most recently from 9222f36 to 866b986 Compare December 7, 2023 15:43
@jcayzac
Copy link
Contributor Author

jcayzac commented Dec 7, 2023

I think I resolved all the issues. The tests are now all passing.

@littledivy
Copy link
Member

Self note: run startup_time benchbot once CI passes

@jcayzac jcayzac force-pushed the fix/21434 branch 2 times, most recently from aaab506 to 5aaad9f Compare December 7, 2023 23:32

Verified

This commit was signed with the committer’s verified signature.
KinectTheUnknown David-Joseph Xayavong
This fixes denoland#21434 for `BroadcastChannel` and `WebSocketStream`.
`--unstable` still enable both, but granular unstable flags now also work:

* `--unstable-net` enables `WebSocketStream`.
* `--unstable-broadcast-channel` enables `BroadcastChannel`.

It also introduces a map to keep track of granular unstable ids without
having to sync multiple places.
@bartlomieju
Copy link
Member

/bench startup_nop_trivial

@denobot
Copy link
Collaborator

denobot commented Dec 8, 2023

startup_nop_trivial

time user system relative
node 24.012 ms 18.363 ms 6.932 ms +101.8%
bun 11.899 ms 5.74 ms 7.363 ms best
deno 14.826 ms 10.067 ms 6.028 ms +24.6%
deno-baseline 14.829 ms 9.618 ms 6.475 ms +24.6%

start: Fri, 08 Dec 2023 07:32:35 GMT

id: 7d9a61b3-94c6-4700-8550-f75eaa14a770

server: c42a2c10-c86a-471b-b4e7-d968a76af264

Copy link
Member

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@crowlKats crowlKats merged commit ca64771 into denoland:main Dec 8, 2023
@jcayzac jcayzac deleted the fix/21434 branch December 8, 2023 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Granular unstable feature flags appear ignored
6 participants