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

Add JS and Wasm for 2.0.x version #197

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Add JS and Wasm for 2.0.x version #197

merged 3 commits into from
Dec 21, 2023

Conversation

zoobestik
Copy link
Contributor

@zoobestik zoobestik commented Dec 19, 2023

Fix issues:
✅ Fix for passing data-target-platform=js-ir
✅ Accept JS_IR for 2.0.x

Chore:
⚠️ update playwright deps.

Add tests:
➕ Platforms restrictions › JS_IR for unsupported version
➕ Platforms restrictions › JS_IR for supported by minor version
➕ Platforms restrictions › JS_IR for supported by major version
➕ Platforms restrictions › WASM for unsupported version
➕ Platforms restrictions › WASM for supported by minor version [chromium only]
➕ Platforms restrictions › WASM for supported by major version [chromium only]

@@ -20,7 +20,7 @@
"@babel/plugin-transform-runtime": "~7.22.4",
"@babel/preset-env": "~7.22.4",
"@babel/runtime-corejs2": "~7.22.2",
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.40.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's required for Wasm test in chrome with enabled WasmGC.

if (!isKeyOfObject(target, TargetPlatforms))
throw new Error('Invalid target platform');

options.targetPlatform && getTargetById(options.targetPlatform);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's real bug - it's impossible to pass js-ir platform. Cause expected js_ir.
Test below.


if (platform === TargetPlatforms.JS_IR && minor < MINIMAL_MINOR_VERSION_IR) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Main issue 2.0.0 has minor less then 5 or 9.

@@ -30,7 +30,9 @@ function isRunRequest(url: URL | string) {

return (
uri.host === API_HOST &&
uri.pathname.match(/^\/?\/api\/\d+\.\d+\.\d+\/compiler\/run$/) !== null
(uri.pathname.match(/^\/?\/api\/\d+\.\d+\.\d+\/compiler\/run$/) !== null ||
uri.pathname.match(/^\/?\/api\/\d+\.\d+\.\d+\/compiler\/translate$/) !==
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Catch for both types of targets.

@zoobestik zoobestik force-pushed the fix-browser-platforms branch 3 times, most recently from c5308ff to 800bf4a Compare December 20, 2023 11:08
@zoobestik zoobestik force-pushed the fix-browser-platforms branch from 800bf4a to 54a2ecb Compare December 20, 2023 11:24
@zoobestik zoobestik merged commit cfb7e5c into master Dec 21, 2023
2 checks passed
@zoobestik zoobestik deleted the fix-browser-platforms branch December 21, 2023 14:21
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