-
Notifications
You must be signed in to change notification settings - Fork 44
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
XPointer Framework syntaxt *style* fragments #18
Comments
I think the functional style may make sense but this doesn't solve the issue of bad interaction with SPAs. For example, they might not handle a If this was just a handful of pages we could maybe say the cost-benefit doesn't favor influencing the design. However, this example was found with just some basic testing and WebMD is a prominent domain. I expect this may not be rare. |
Let's just avoid changing the language to match the phrasebook (see also Monty Python's cautionary tale). 😄 |
If we have fragments that are meant "for the browser" we might have to avoid exposing them to the page. That would be a nice privacy bonus, as well, but is a deeper implementation. |
So it looks like the "[fragments meant] for the browser" is becoming a reality per #15 (comment) It would still be great to see the fragment style designed to be extensible--as other Web clients could benefit from this use also. |
I'd add a point of caution, we're currently just experimenting with this - there's no guarantee this will ship in this state.
What do you mean by this? If |
I've no real issue with Given the current README example of...
...I'd find this approach to be more intuitive:
...as each part reads as a parameter to a function vs. a single value made of a unique, comma-separated micro-syntax (i.e. "If provided, the prefix must end (and suffix must begin) with a dash (-) character."). |
It's certainly a matter of taste but I think the two are functionally equivalent. The dash micro-syntax or something like it would still be needed since all but the second parameter are optional so you need some way to disambiguate the different possibilities. We've stuck with the key-value syntax; one of the main benefits being its similarity to the media-fragments syntax. |
Closing this out as I think this is effectively obsolete. I think most of the goals stated here are effectively met (the spec leaves open the possibility of extension via Feel free to reply if there's still something unresolved. |
Thinking through the "mixing with SPA's" issue in #15, I wonder if the XPointer Framework syntax's style might be useful to avoid collisions and enable "mixing."
We used this approach in the Web Annotation WG's Selectors and States note. The same syntax style can be seen in SVG's fragment identifiers like
#svgView()
This style is less frequently used (other than the standardized ones like
svgView()
) by JS developers building SPAs. Additionally, these can more easily accommodate mixing and more clearly be "functional"--which avoids confusion between which client this fragment was intended for (the browser or the Web app).For example using
find()
rather thantargetText=
avoids collision with site key/value pairs while also feeling more functional/active.Structuring the URL has the interesting side-effect that when the
location.hash
is parsed (sans-#
) withURLSearchParams
the results shake out into two groups:page_id=5
)find("on sale")
):Current JS demo below....
This avoids "magic strings" (like
targetText
) polluting the key space, while still making these easily shimmable via JS.Additionally, once there is a
find()
(ortargetText()
orselector()
or whatever) these could be gleaned by the browser engine (possibly removing it from the hash) and kept for its own use--while still following existing URL design and extensibility patterns.It would also open the door to a more extensible space and patterns for future development, by suggesting that
#
values may be&
delimited and may contain "functional fragments" which may be ignored or implemented by the client (whether browser or Web app).Thoughts?
The text was updated successfully, but these errors were encountered: