Skip to content

Expose JetStream global to workloads#139

Merged
camillobruni merged 15 commits into
WebKit:mainfrom
camillobruni:2025-08-13_JetStream_global
Aug 15, 2025
Merged

Expose JetStream global to workloads#139
camillobruni merged 15 commits into
WebKit:mainfrom
camillobruni:2025-08-13_JetStream_global

Conversation

@camillobruni
Copy link
Copy Markdown
Contributor

Using global variables makes it hard to follow where they originate.
Exposing all the external settings via a global JetStream object makes this a bit more obvious.

  • Expose globalThis.JetStream in the workload
  • Only conditionally expose the isInBrowser / isD8 settings (benchmarks should not rely on this)
  • Use a Proxy-hack to avoid accidental typos fail silently when accessing JetStream settings

@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 14, 2025

Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit de2e687
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/689f0f23ac3afb000883f67e
😎 Deploy Preview https://deploy-preview-139--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@camillobruni camillobruni requested a review from danleh August 14, 2025 10:55
Copy link
Copy Markdown
Contributor

@danleh danleh left a comment

Choose a reason for hiding this comment

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

LGTM with nits, but let's wait for Keith.

Comment thread Dart/build/run_wasm.js Outdated
Comment thread JetStreamDriver.js
},
async: true,
deterministicRandom: true,
exposeBrowserTest: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note to self / Wasm folks: once Transformers.js lands (WIP), we should get rid of this workload (so there is no need to fix this global access).

Comment thread JetStreamDriver.js Outdated

if (!!this.plan.deterministicRandom)
scripts.addDeterministicRandom()
if (!!this.plan.exposeBrowserTest) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is my understanding correct that this is a temporary thing, to remove once we have fixed the workloads to not rely on global isD8 or isInBrowser? If yes, let's add a // TODO: Remove this function and exposeBrowserTest once workloads are fixed. to the top of addBrowserTest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all the worker tests will keep on using this, since we don't have uniform Worker support in the shells yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, right. Not temporary then, thanks. How hard would it be to polyfill worker stuff for shells?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should push for basic Worker APIs in the shells too, that's what we ultimately did for v8.
Definitely something that's up on the list.

Comment thread cli.js Outdated
@camillobruni camillobruni merged commit 0fc1bfe into WebKit:main Aug 15, 2025
10 checks passed
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.

2 participants