-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
feat(respecDocWriter): use locally installed respec version #2957
Conversation
timeout = 300000, | ||
disableSandbox = false, | ||
debug = false, | ||
useLocal = false, |
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.
Should this be a string/boolean instead of just boolean? Having a string could allow using a custom URL (say, from unpkg) instead of using local one.
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.
I don't have a strong opinion. Whatever you think is best... or leave it for now, and add the custom URL when we need it.
return path.startsWith("/respec/builds/"); | ||
default: | ||
// localhost, file://, and everything else | ||
return /\/builds\/respec-[\w-]+\.js$/.test(path); |
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.
Why not just respec-[\w-]+\.js
?
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.
Could also match respec-worker, respec-highlight
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.
Yes, I mean why builds/
?
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.
We're only replacing respec-[profile]
here, which is in builds/
. Let me try if we can do without /builds/
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.
Adding /builds/
reduces risk of false-positive though. A mismatch here means crash. Say, some adds their config as respec-config.js
(haven't seen cases, but possible). builds/respec-config.js
is less likely.
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.
Download from cache is kinda slow though. Given we already have a browser installed, it'll definitely feel slower to not use it.
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 should let us skip download though.
Nice find on passing executable path. Can set it with env variables.
I'll play more with it, if we do want to go with playwright. Though, I'm okay with puppeteer also.
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.
It's microsoft/playwright#5952 vs puppeteer/puppeteer#4208 now.
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.
@saschanaz I think intercepting only builds/respec-{profile}
should be good enough for now?
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.
Yeah, it seems it won't be fixed anytime soon.
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.
@saschanaz importScripts from workers should now be fixed on vNext/master of playwright. When v1.11.0 comes out, feel free to give it a try and raise an issue if you encounter problems. 😄
NB: This fix should simply prevent the importScripts from hanging; I'm not sure of the general story for request interception of SW traffic.
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.
This looks good to me.
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.
LGTM
6967e73
to
4bd9ca3
Compare
Closes https://github.com/w3c/respec/issues/2874