-
Notifications
You must be signed in to change notification settings - Fork 222
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
xk6-browser API documentation #642
Conversation
@imiric, Could you please take a look at my initial commits? I'll keep doing it like that if it's fine. At this moment, a thorough review is unnecessary, and I don't want to take much of your time. I only need to hear from you that the formatting is good, and we can keep doing it like that :) PS: The text is a direct copy from the Playwright's documentation. |
e11bbc7
to
46b9e04
Compare
46b9e04
to
2fdc597
Compare
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
@imiric, I couldn't run it locally using I tried a lot of stuff. Deleting the |
I didn't do anything special. Just: $ rm -rf node_modules
$ npm i
$ npm start I'm using Node v16.14.2 and npm v8.5.0. On And also another error which I think is what's making
The Markdown here is very brittle and it's likely some formatting change broke it. 😞 I'll take a look. |
Unfortunately, links in h3s are not supported :-/
8b339ed
to
a9c70c7
Compare
I pushed a "fix" for The cause were the links in |
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
@imiric, thanks for looking into this. Now it works! I created links for Regarding red-x (not implemented), I added ❌ with a tooltip. The tooltip content is global, and we can use it for other stuff in the same markdown file. Please take a look at the commit 4c7d4da and let me know WDYT. One thing I noticed is that the Browser page (and also others) can be very lengthy and crowded. We better provide a list of methods first on a page and then have a page for each method. For example, we can list the methods in a table on the Browser page, and then people can click on the links to see each method such as As in here: https://k6.io/docs/javascript-api/k6-html/selection/. The selectors are on a single page and then each link navigates to another page. |
@imiric, by the way, let's copy-paste Playwright descriptions first. We can rephrase them after we finish. You don't have to follow the same route, though :) I want to work in this way as the process is already complicated (Gatsby etc.). |
- Finish the browser.newContext list - Started on browser.newPage
+ Removes descriptions of missing APIs (See: #508 (comment)) + Formats input and return value tables for all. + Adds a link for browser.close so that the link in browser.on description works. + Updates browser.on() to browser.on('disconnected') per Playwright docs
That feels like we'd be doing double the work: first to copy things and then to rephrase. Which would involve 2 review passes as well. What should I review on the first pass? Should I ignore if the Playwright docs are wrong for us, as in this case? It wouldn't be much more work to paraphrase their docs or come up with our own docs from the start, and we can avoid double reviews. It will be a lot of content to go through anyway... Let's first agree on the layout changes and do the final content after that.
Yeah, that might be better. We probably don't need it for every object, so let's decide on a case by case basis whether it needs splitting? In the case that we do split it, let's remove the sticky right-side menu. |
Re: the tooltip, it looks great in Firefox, but it doesn't show up for me in Chromium v99: Maybe something with the SVG? One thing that's a bit confusing is that it's an empty link. It should only be a link if there's an associated GitHub issue we can link to. I guess we can hack it to not look and behave like a link if it's empty, but it feels a bit wonky. Especially since clicking on it changes the URL to BTW, is that a generic Markdown feature or Gatsby's? |
I tentatively agree (on 2 review passes—but it often happens anyway). However, I don't think it would be a lot of time-consuming work. You can first check out the types, methods, return types, etc. without looking at the descriptions (we can leave them empty as well). Then, the next commit will only show the paraphrased descriptions, and you won't go through the same process of checking the other stuff. I'm suggesting this because I feel kind of overwhelmed here.
That's basically what I've been trying to say :) Let's first add the types, methods, properties, and agree on the layout. Make a commit. Then, paraphrase in the next commit.
Wouldn't the content look weird if we do it on a case-by-case basis? I mean, people would need to go to a different page for some and stay on the same page for others. But I understand that some of them would be really weird (with a little content on a whole page, yeah). We can try doing it for the Browser type and then see what it looks like to decide which way to go. WDYT? |
I'm using Chrome v100 and Safari 15.4, and it works fine.
I wish I had an idea 🤷
Yeah, I know, but let me know if you have another idea cause I couldn't find another one (another technical trick). It's hacky-wacky stuff of Markdown itself.
Wow, it crashed Gatsby when I did so! Weird. |
@imiric, WDYT about this one? |
No, I mean let's agree on a layout template; how to implement the tooltip, split pages or not, other formatting, etc. And then start working on the final version of the content. But OK, if you find it easier this way, we'll handle it. BTW, can we use this PR to agree on the layout changes and then close it? I don't want to get a GH notification everytime you push to this branch, and viceversa. We can discuss anything else quicker over Slack anyway.
I think it would look weirder if we had split pages for small objects like Let's try to think of a different way of implementing the tooltip. I'd rather have to repeat it everywhere then deal with more hacks. I'll experiment with something on the Re: invisible links, we don't really need them. All |
21511a9
to
1181f8c
Compare
1181f8c
to
0134e44
Compare
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, besides the minor comments here.
The x
and tooltip looks good. I'm assuming you'll split this page later, right?
Can we close this PR since we mostly agree on the layout changes? We can merge the branch later into xk6-browser-new-format
once we make more progress.
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
src/data/markdown/docs/30 xk6-browser/01 xk6-browser/01-browser.md
Outdated
Show resolved
Hide resolved
As discussed on Slack, methods with arguments don't work. For example: + browser.on('disconnected') fails the Gatsby server. + browser.newContext([options]) has an invalid link on the left navigation menu. + browser.newPage is similar to newContext. We need to figure out how to move forward with these problems.
Let's wait until you make a final review of the new page structure (subpages). Then we can close it. |
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
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment) Resolves: #642 (comment)
No description provided.