Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +2 |
internal/frontend: migrate go-mod-viewer.appspot.com to pkgsite.go.dev/go-mod-viewer
There is pkg.go.dev, the website, and x/pkgsite, the repo.
After this CL is deployed, can you visit pkg.go.dev/go-mod-viewer/path/to/module? It looks that way.
Put that info in this message.
for (const el of document.querySelectorAll<HTMLSelectElement>('.js-highlight')) {
What does this do?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/frontend: migrate go-mod-viewer.appspot.com to pkgsite.go.dev/go-mod-viewer
There is pkg.go.dev, the website, and x/pkgsite, the repo.
After this CL is deployed, can you visit pkg.go.dev/go-mod-viewer/path/to/module? It looks that way.
Put that info in this message.
Correct; I misspoke in the CL description.
Fixed.
for (const el of document.querySelectorAll<HTMLSelectElement>('.js-highlight')) {
What does this do?
Preserves the client-sided highlighting based on the url fragment: https://github.com/rsc/swtch/blob/master/app/go-mod-viewer/viewer.js
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +2 |
for (const el of document.querySelectorAll<HTMLSelectElement>('.js-highlight')) {
Neal PatelWhat does this do?
Preserves the client-sided highlighting based on the url fragment: https://github.com/rsc/swtch/blob/master/app/go-mod-viewer/viewer.js
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/2d23d09d-8147-4bea-aba5-c4f90514ab8b
kokoro-CI | -1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/frontend: migrate go-mod-viewer.appspot.com to pkg.go.dev/go-mod-viewer
Can we make this endpoint URL shorter? This was the name of an AppEngine app; we needn't preserve it here. For starters, the "go" part can clearly go. I don't know what endpoints already exist, but I wonder whether this can be something as short as /src or /mod or /view.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Maybe link to https://go.dev/issue/66432 and https://go.dev/issue/66653 which could be fixed in the future using this
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
internal/frontend: migrate go-mod-viewer.appspot.com to pkg.go.dev/go-mod-viewer
Can we make this endpoint URL shorter? This was the name of an AppEngine app; we needn't preserve it here. For starters, the "go" part can clearly go. I don't know what endpoints already exist, but I wonder whether this can be something as short as /src or /mod or /view.
I chose `/view/`. Let me know what you think about the resulting file structure.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Maybe link to https://go.dev/issue/66432 and https://go.dev/issue/66653 which could be fixed in the future using this
I took a cursory look at the issues; could you elaborate on how it might apply to https://go.dev/issue/66432?
I think I see how it applies to https://go.dev/issue/66653.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
After this CL is deployed, a module can be viewed in the following manner: https://pkg.go.dev/go-mod-viewer/rsc.io/qu...@v1.5.2
view
(and throughout)
After this CL is deployed, a module can be viewed in the following manner: https://pkg.go.dev/go-mod-viewer/rsc.io/qu...@v1.5.2
Presumably this displays a directory listing of the module (recursively?). What are the individual file URLs?
// GoModViewPage holds the information for a page
delete throughout
j := strings.Index(urlPath[i:], "/")
if j < 0 {
mod, file = urlPath, ""
} else {
mod, file = urlPath[:i+j], urlPath[i+j+1:]
}
strings.Cut
if resp.StatusCode != 206 {
http.StatusPartialContent
But this could use some explanation.
resp.Body.Close()
Why not defer this at L214 instead of repeating it 3 times?
n := 1 + bytes.Count(data, nl)
lines := make([]line, n)
wid := len(fmt.Sprintf("%d", n))
wid = (wid+2+7)&^7 - 2
n = 1
// Round up width of maximum line number to next tab stop (8).
Commit-Queue | +1 |
After this CL is deployed, a module can be viewed in the following manner: https://pkg.go.dev/go-mod-viewer/rsc.io/qu...@v1.5.2
Neal PatelPresumably this displays a directory listing of the module (recursively?). What are the individual file URLs?
It provides the same view as https://go-mod-viewer.appspot.com/gonum.org/v1/go...@v0.16.0/stat
It doesn't recursively list (like `find`); rather, it's like `ls`.
After this CL is deployed, a module can be viewed in the following manner: https://pkg.go.dev/go-mod-viewer/rsc.io/qu...@v1.5.2
Neal Patelview
(and throughout)
Done
// GoModViewPage holds the information for a page
delete throughout
If making consistent throughout, then filenames of the static content should be changed as well as all the CSS class names and the references inside the template.
WDYT?
j := strings.Index(urlPath[i:], "/")
if j < 0 {
mod, file = urlPath, ""
} else {
mod, file = urlPath[:i+j], urlPath[i+j+1:]
}
strings.Cut
I transposed all of rsc@ code without editing; do you think it's reasonable to modernize / optimize it in a follow up CL?
ctx: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer/main.go
if resp.StatusCode != 206 {
http.StatusPartialContent
But this could use some explanation.
This was similarly transposed from rsc@ source: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer
See comment above about second pass in a follow up CL.
resp.Body.Close()
Why not defer this at L214 instead of repeating it 3 times?
This was similarly transposed from rsc@ source: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer
See comment above about second pass in a follow up CL.
n := 1 + bytes.Count(data, nl)
lines := make([]line, n)
wid := len(fmt.Sprintf("%d", n))
wid = (wid+2+7)&^7 - 2
n = 1
// Round up width of maximum line number to next tab stop (8).
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
After this CL is deployed, a module can be viewed in the following manner: https://pkg.go.dev/go-mod-viewer/rsc.io/qu...@v1.5.2
Neal PatelPresumably this displays a directory listing of the module (recursively?). What are the individual file URLs?
It provides the same view as https://go-mod-viewer.appspot.com/gonum.org/v1/go...@v0.16.0/stat
It doesn't recursively list (like `find`); rather, it's like `ls`.
Even better. Thanks.
// GoModViewPage holds the information for a page
Neal Pateldelete throughout
If making consistent throughout, then filenames of the static content should be changed as well as all the CSS class names and the references inside the template.
WDYT?
Yes, let's make it consistent.
j := strings.Index(urlPath[i:], "/")
if j < 0 {
mod, file = urlPath, ""
} else {
mod, file = urlPath[:i+j], urlPath[i+j+1:]
}
Neal Patelstrings.Cut
I transposed all of rsc@ code without editing; do you think it's reasonable to modernize / optimize it in a follow up CL?
ctx: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer/main.go
Ah, I didn't notice this code was just moving. Fine to leave as is.
if resp.StatusCode != 206 {
Neal Patelhttp.StatusPartialContent
But this could use some explanation.
This was similarly transposed from rsc@ source: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer
See comment above about second pass in a follow up CL.
Acknowledged
resp.Body.Close()
Neal PatelWhy not defer this at L214 instead of repeating it 3 times?
This was similarly transposed from rsc@ source: https://github.com/rsc/swtch/tree/master/app/go-mod-viewer
See comment above about second pass in a follow up CL.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/frontend: migrate go-mod-viewer.appspot.com to pkg.go.dev/go-mod-viewer
Neal PatelCan we make this endpoint URL shorter? This was the name of an AppEngine app; we needn't preserve it here. For starters, the "go" part can clearly go. I don't know what endpoints already exist, but I wonder whether this can be something as short as /src or /mod or /view.
I chose `/view/`. Let me know what you think about the resulting file structure.
Acknowledged
// GoModViewPage holds the information for a page
Neal Pateldelete throughout
Alan DonovanIf making consistent throughout, then filenames of the static content should be changed as well as all the CSS class names and the references inside the template.
WDYT?
Yes, let's make it consistent.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
Neal PatelMaybe link to https://go.dev/issue/66432 and https://go.dev/issue/66653 which could be fixed in the future using this
I took a cursory look at the issues; could you elaborate on how it might apply to https://go.dev/issue/66432?
I think I see how it applies to https://go.dev/issue/66653.
66432: the module source doesn't host a view of individual files. with this /view/, we'd be able to see the source code.
66653: the module source can lie about the file contents (e.g. tag was changed after proxy caching). with /view/, we'd always see what's in the proxy cache, matching the most common source for go get.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/frontend: migrate go-mod-viewer.appspot.com to pkg.go.dev/go-mod-viewer
Neal PatelCan we make this endpoint URL shorter? This was the name of an AppEngine app; we needn't preserve it here. For starters, the "go" part can clearly go. I don't know what endpoints already exist, but I wonder whether this can be something as short as /src or /mod or /view.
Neal PatelI chose `/view/`. Let me know what you think about the resulting file structure.
Acknowledged
Now that I think about it, pkgsite already has a source file view under /files/
https://cs.opensource.google/go/x/pkgsite/+/master:internal/frontend/server.go;l=215
maybe it should be unified with this?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |