Closed auchenberg closed 9 years ago
Yeah good call. "Cross-domain" filter for sure.
Perhaps match on all fields? (for "stylesheet" it would have 16 matches, which seems OK for such a common thing.
Yeah, it should simply filter on all property name and values.
I was thinking how to implement that and I figured out we need a polymer component that:
As for the UI, I really like search widget in the polymer docs: https://www.polymer-project.org/1.0/docs/devguide/feature-overview.html .
Eric agreed to work on that :clap:
Just so I don't miss something, are these all the protocol.json properties that should be used in filtering:
Domains
Types
Commands
Events
Also, I'm thinking we might be able to write a utility (like the existing create-domain-files.js) that saves us from loading the entire protocol json file. Any thoughts?
IMO searching inside descriptions and property names will create a lot of false positives. Maybe lets limit the first version of search to names/ids? If we find it too limited it should be easy enough to add descriptions and property names later on. What do you think?
utility that saves us from loading the entire protocol json file
That's a great idea. protocol.json is huge and I started thinking about caching it in localstorage (after initial load), but this solution has a lot of drawbacks (keeping it up to date, initial load v.long). If we create a separate json, limited to data that search actually needs, we should be able to get away with relying on browser cache. We can probably even embed it in HTML.
Tossing the protocol in sessionstorage seems like a decent eviction policy for us.
I'm +1 on descriptions+property names, but it will require some use and feedback either way.
excited for this one!
Sorry for being out of the loop, but by eviction policy do you mean temp solution?
I've started with a two-part solution that I'll push to a branch soon -- still using a smaller search index rather than the entire json file, but only aggregating "primary" keywords (which are domain, method, type, and event names). @kdzwinel had a good point about false positives in descriptions, so we might want something a bit more sophisticated to handle those keywords (in part two of this feature).
i was just saying that if there was a concern about fetching protocol.json on every pageload we could cache it in sessionstorage.
the above sgtm
Hi guys,
I've got a mostly-done version of Search working. Check it out here: https://ericguzman.github.io/debugger-protocol-viewer/
Let me know if run into any issues, or have any suggestions while I'm putting the final bit of polish on it + testing cross-browser.
bug: I would expect power
would include results for the canProfilePower
method
Outside of this, it's looking great. nice one.
Whoa, this looks great! Awesome job :+1:
Small issues that I found:
getResourceTree
while being on the /debugger-protocol-viewer/Page
page).<input type=search
was used instead of <input type=text
we would get a native clear button for freeLooks great!
A little feature request: When searching for "css.enable" (
@ericguzman would love to get this this work updated and merged when you get a moment
@paulirish Been tied up with work work, but I'll merge the update with bug fixes/feature requests in the next couple days.
Search landed :fireworks: Should we close this task? IMO all further improvements should get separate tickets.
yup!
A nifty feature would be to be able to filter/search. Imagine you wanna look up something with stylesheets, you type "stylesheets" and it filters the methods/events that has a name or property matching.
Would be extremely useful when looking up stuff, and should be relatively easy, as we have all the data available in protocol.json