-
Notifications
You must be signed in to change notification settings - Fork 373
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: change gnoweb
to add URL query string to render path
#2876
feat: change gnoweb
to add URL query string to render path
#2876
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2876 +/- ##
==========================================
- Coverage 63.33% 63.06% -0.28%
==========================================
Files 548 548
Lines 78601 81101 +2500
==========================================
+ Hits 49780 51143 +1363
- Misses 25466 26525 +1059
- Partials 3355 3433 +78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hey, what is the expected direct or indirect impact of this change? Edit: found the answer here: #2584 (review) |
I will write a proper PR description soon and extend the unit tests for this case. |
gnoweb
to add URL query arguments to render pathgnoweb
to add URL query string to render path
This PR aimed to promote the use of a `p/` library for managing special help links from contracts. It also provided an opportunity for me to realize that our discussion about changing the `$` symbol would require some parsing and detection from the `gnoweb` perspective. If we want a simple library like this one, the goal should be to ideally craft a link to the current package without specifying the realm path. Relative URLs worked well with `?`, but they won't function with `$`. As an alternative, we can have this package look for `std.PrevRealm().PkgAddr` if it is not specified. cc @jeronimoalbi @thehowl @leohhhn Related with #2602 Related with #2876 --------- Signed-off-by: moul <[email protected]> Co-authored-by: Leon Hudak <[email protected]>
Public query arguments are the standard ones that come after the "?" symbol, while the private arguments come after the "$" symbol. Private gnoweb arguments are used for specific gnoweb features, some of which are `help` or `func` and are filtered from the render path when rendering realms.
I believe you missed the help button taking you to In
|
Co-authored-by: leohhhn <[email protected]>
And, for
I think that CTRL+F on examples/ should help you find other broken links, like |
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.
Good after fixing links in examples, we'll fix other broken links as we find them
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.
pre-approving, well done!
Co-authored-by: Manfred Touron <[email protected]>
Merging with a codecov drop because we will be scraping the whole gnoweb codebase soon; to be replaced with a full package refactor. |
Description
This PR introduces a change for gnoweb to also pass the URL query string as part of the render path.
Passing the URL query string is required to support arguments when rendering realms, which is the case of the AVL pager implementation in #2584 that uses "page" and "size".
The PR changes the behavior of realm rendering calls by adding URL query arguments as suffix of the
path
argument, so URLs likehttps://gno.land/r/demo/foo:bar?baz=42
would callRender(path)
with "bar?baz=42" as value ofpath
.It also changes how special gnoweb arguments like
help
offunc
are specified which now must be done by using the$
character, for example:https://gno.land/r/demo/foo$help&func=Bar&name=Baz
https://gno.land/r/demo/foo:example$tz=Europe/Paris
https://gno.land/r/demo/foo:example?value=42$tz=Europe/Paris
Note that
__func
is nowfunc
, without the underscore prefix.Possible Issues
The change could potentially affect realm or package implementations that rely on the render path in cases where the
?
is not expected, for example when parsing or splitting it. Because of that there might be changes required to handle the case where a caller sends query string arguments. Realms and packages should be able to handle render paths which could look likerender/path?arg=1&arg=N
.Links that still use
?
,help
and__func
won't work as expected, they must be changed to use$
instead of?
, andfunc
instead of__func
.Packages
gno.land/p/moul/txlink
andgno.land/p/moul/helplink
has to be refactored to properly generate links.