component / component.github.io

components search using component-crawler
http://component.github.io
119 stars 20 forks source link

Drive search from query string #82

Closed JamesMGreene closed 9 years ago

JamesMGreene commented 9 years ago

I know that Component is basically abandoned now but it would be really nice if someone who knows the system (and the correct "component way" to do this) could take probably ~30 minutes or less to add this....

It would be nice if the search could be driven from the query string, i.e. navigating to http://component.github.io/?q=dialog would trigger an automatic search for dialog when the page is finished loading.

stephenmathieson commented 9 years ago

you can probably do

var qs = require('querystring') // (component/querystring)

// . . . 

var q = qs.parse(location.search).q || '';
search.show(q);

instead of search.show('') ... but i havent tested this.

dandv commented 9 years ago

Is Component abandoned?

stephenmathieson commented 9 years ago

I use both component v0.19 and duo pretty regularly...

JamesMGreene commented 9 years ago

@dandv: My understanding per componentjs/component#594, componentjs/component#601, and componentjs/component#604 is that Component is now in maintenance-only mode.

Is that the correct interpretation, "maintainers" @timaschew, @netpoetica, @trevorgerhardt, @clintwood, and @jasonkuhrt?

JamesMGreene commented 9 years ago

@stephenmathieson: Your earlier code snippet looked valid to me upon further review. I'll try to submit a PR for it later tonight.

19h commented 9 years ago

Component isn't dead nor in maintenance-only. Just because the original authors went bonkers this project isn't abandoned. @timaschew works on component avidly and even then, we're using it for the very fundamental build processes in our company. (disclaimer: @timaschew works there as well)

timaschew commented 9 years ago

I plan to continue both maintenance and features for component until latest browsers will support module loading and web components natively.

A main feature of component is that it supports local modules/dependencies, which doesn't exist for other tools like browserify or duo. This is a reason for me to use copmonent (not only at our company) and continue development on component.

I have some ideas for the next release to support package.json if a projects without a component.json. This is sometimes an issue, because the maintainers of projects don't want to maintain several manifest files.

jasonkuhrt commented 9 years ago

For what its worth, maybe a second wind for component would be supporting the Concord spec. I'm putting this same question out there with duo:

JamesMGreene commented 9 years ago

Alright, so working on the PR for this per @stephenmathieson's tip did work. However, it brings up a UI quirk that needs a design decision:

So, design-wise... maybe one of those two end results is acceptable (at least for a quick win on getting this search functionality in)? If not, then we should consider [at least] the following:

Local screenshots:

image

image

JamesMGreene commented 9 years ago

Maybe the latter (showing the search term without a prefix label) is actually OK because the cursor is still there blinking. Thoughts?

stephenmathieson commented 9 years ago

i'd go with the second option

JamesMGreene commented 9 years ago

Yeah, it actually looks pretty good the more I look at it. Not sure if I did the "right" thing for it but I'll submit the PR shortly and you all can judge me there. :wink:

JamesMGreene commented 9 years ago

PR available for review: #83

JamesMGreene commented 9 years ago

Thank you everyone for the guidance, correction of misinformation [on the livelihood of Component], and merging my PR. :gift_heart: