Skip to content
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

Rewrite search page in Preact #797

Closed
benhalpern opened this issue Oct 2, 2018 · 12 comments
Closed

Rewrite search page in Preact #797

benhalpern opened this issue Oct 2, 2018 · 12 comments
Labels
area: search/indexing search results and indexing internal team only internal tasks only for Forem team members
Milestone

Comments

@benhalpern
Copy link
Contributor

benhalpern commented Oct 2, 2018

Feature Request or Task

As a user, I will want additional filters to narrow things down in my search. e.g. #360, but we don't currently have a great base for adding to the valnilla page.

Technical details

Right now, all the code for search is in _search.html.erb basically it's inline on the search page.

We want to move it to app/javascript. Create a new component in the src file called SearchResults and add a new pack called SearchResults, and then add <%= javascript_pack_tag "SearchResults", defer: true %> to _search.html.erb

Definition of Done

The current functionality has been replicated in clean, tested Preact code.

@nickytonline
Copy link
Contributor

Not sure why I didn't see #360 before. I'll outline what needs to be done as I migrated the first part of search to preact. I should have some free time coming up to grab this or I'd be happy to pair with someone, if they want to learn the ropes a bit.

@ascii-dev
Copy link

@nickytonline I would like to work on this while learning the ropes and I'll be happy to pair up with you on it.

@benhalpern
Copy link
Contributor Author

Yeah, @nickytonline @ascii-dev I think that would be a great match. I think you two pairing would be awesome.

@nickytonline
Copy link
Contributor

Still settling in to the new job, but gonna start looking into this as not much activity happening here at the moment.

@nickytonline
Copy link
Contributor

So buildArticleHTML.js.erb can be converted into stateless functional components. I've started working on that.

Most of what's in _algolia_search.html.erb can go into the utilty functions of search, ./app/javascript/src/utils/search.js.

The search results have their own container element that we'll need to rerender to. This ties in to the SearchResults pack that @benhalpern mentions in the initial story.

Still digging to see what else is required.

@ascii-dev
Copy link

Hi, @nickytonline I've also not been able to look into this because of work. But anyway I might be needed on it?

@mstruve
Copy link
Contributor

mstruve commented May 12, 2020

Ah look at this there is an Issue for the refactor I asked @nickytonline to do, little outdated but definitely still looking to get this done in Elasticsearch!

@mstruve mstruve added internal team only internal tasks only for Forem team members EOY priority and removed type: feature request labels Nov 6, 2020
@nickytonline
Copy link
Contributor

Just dropping some thoughts on this:

@mstruve
Copy link
Contributor

mstruve commented Jan 11, 2021

Currently we return a search page results page with the results rendered on the server-side as markup.

Where are you seeing this? If you look at the search controller you will see that all of the endpoints return JSON so I think we are good to go on the backend.

@nickytonline
Copy link
Contributor

Ahh, I wasn't aware that they all return JSON. Thanks @mstruve!

@vaidehijoshi
Copy link
Contributor

vaidehijoshi commented Jan 14, 2021

This should be a RFC :)

@vaidehijoshi
Copy link
Contributor

@benhalpern I'll leave it to you to close this issue out if/when you decide to convert it into a RFC. Maybe @nickytonline can help champion it, too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: search/indexing search results and indexing internal team only internal tasks only for Forem team members
Projects
None yet
Development

No branches or pull requests

9 participants