-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[js/web] fix package export for bundlers #23257
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 30 out of 45 changed files in this pull request and generated 5 comments.
Files not reviewed (15)
- js/web/test/e2e/exports/testcases/nextjs-default/.gitignore: Language not supported
- js/web/test/e2e/exports/testcases/nextjs-default/app/globals.css: Language not supported
- js/web/test/e2e/exports/testcases/nextjs-default/app/page.module.css: Language not supported
- js/web/test/e2e/exports/testcases/nextjs-default/jsconfig.json: Language not supported
- js/web/test/e2e/exports/testcases/nextjs-default/package.json: Language not supported
- js/web/test/e2e/exports/testcases/nextjs-default/components/onnx-helper.js: Evaluated as low risk
- js/web/test/e2e/exports/testcases/nextjs-default/components/onnx-test-bar.js: Evaluated as low risk
- js/web/test/e2e/exports/testcases/nextjs-default/app/page.js: Evaluated as low risk
- js/web/lib/backend-wasm.ts: Evaluated as low risk
- js/web/lib/wasm/wasm-factory.ts: Evaluated as low risk
- js/web/test/e2e/exports/README.md: Evaluated as low risk
- js/web/lib/wasm/proxy-wrapper.ts: Evaluated as low risk
- js/web/script/build.ts: Evaluated as low risk
- js/web/test/e2e/exports/testcases/nextjs-default/app/layout.js: Evaluated as low risk
- js/web/test/e2e/exports/testcases/nextjs-default/next.config.mjs: Evaluated as low risk
Comments suppressed due to low confidence (5)
js/web/test/e2e/exports/testcases/nextjs-default.md:15
- [nitpick] The term 'App Router' should be 'app router' to match the casing used in the rest of the document.
√ Would you like to use App Router? (recommended) ... No
js/web/test/e2e/exports/main.js:30
- Ensure that the ANSI escape codes for colored output are intentional and correctly handled in environments that might not support them.
await runDevTest('vite-default', '\x1b[32m➜\x1b[39m \x1b[1mLocal\x1b[22m:', 5173);
js/web/test/e2e/exports/main.js:31
- Ensure that the ANSI escape codes for colored output are intentional and correctly handled in environments that might not support them.
await runProdTest('vite-default', '\x1b[32m➜\x1b[39m \x1b[1mLocal\x1b[22m:', 4173);
js/web/lib/wasm/wasm-utils-import.ts:1
- The
preload
function should have an explicit return type defined for better readability and maintainability.
preload = async (absoluteUrl: string): Promise<string> => {
js/web/lib/wasm/wasm-utils-import.ts:12
- [nitpick] The error handling in the
normalizeUrl
function should provide more context to help with debugging.
normalizeUrl = (filename: string, prefixOverride?: string) => {
await page.waitForSelector('#ortstate', { visible: true }); | ||
// if multi-thread is enabled, check the checkbox | ||
if (multiThread) { | ||
await page.locator('#cb-mt').click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method 'page.locator' is not valid in Puppeteer. Use 'page.$' or 'page.$eval' instead.
await page.locator('#cb-mt').click(); | |
await (await page.$('#cb-mt')).click(); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method 'page.locator' is not valid in Puppeteer. Use 'page.$' or 'page.$eval' instead.
Seems like a false statement. page.locator()
works well in this test and there is also API reference for the function:
https://pptr.dev/guides/page-interactions#locators
Description
This PR tries to fix #22615. (see detailed description in the issue)
A perfect solution would be too difficult to make, because there are a huge number of combinations of usage scenarios, including combinations of development framework, bundler, dev/prod mode, and so on.
This PR is using the following approach:
npm install
for packages built locallynpm run dev
to start dev server and use puppeteer to launch the browser to testnpm run build && npm run start
to test prod build and use puppeteer to launch the browser to testimport.meta.url
to afile://
string