nuxt-modules / algolia

🔎 Algolia module for Nuxt
https://algolia.nuxtjs.org/
MIT License
191 stars 35 forks source link

Add routing URLs #86

Closed podlebar closed 2 years ago

podlebar commented 2 years ago

Is your feature request related to a problem? Please describe.

With Nuxt 2 there was a way to have routing URLs so you got for each facet clicked a change in the URL. That URL was shareable and it was a huge benefit in crosslinking a faceted search page thru the whole website.

Describe the solution you'd like

It would be nice to have this option to create urls that you can share and will lead to correct results. (Similar to: https://www.algolia.com/doc/guides/building-search-ui/going-further/routing-urls/vue/#combining-with-nuxtjs)

Describe alternatives you've considered

Use the oldschool way with the vue 3 library and somehow integrate the router by myself but if there is such a great module it would be nice to have it out of the box instead of starting hacking :)

Baroshem commented 2 years ago

Hey @podlebar

Thanks for creating this feature proposition!

I am not sure however if it should be a responsibility of a module to have this functionality. From your description, this feature can be done on the Nuxt project side (not on the module side). The reason why I don't think it is a good idea to implement it on the module side is that there can be multiple approaches to how this routing could be handled so it will be difficult to implement a generic (agnostic) approach that will serve multiple cases (without forcing users to use one).

Normally I would recommend starting implementing that and create a pull request but in this particular case I think you could waste time on doing that (while there are other interesing features that this module is still missing ;) )

podlebar commented 2 years ago

i understand.. but than i ask myself why https://github.com/nuxt-community/algolia-module/issues/83 should be in this module as it's also possible to implement without this module :)

is there a rule of thumb what should be in this module and what not?

Baroshem commented 2 years ago

Good question @podlebar , let me explain.

The idea behind this AlgoliaSearchBar component is to have a Vue component that just works. The user would only have to style it the way they like (i.e. with TailwindCSS). They can use it or not, it is up to them. The component can utilize the slots and props to give the user the customizability they need to adjust the component to match their needs. Something like Vue-Instantsearch (but the problem here is that it provides some functionality out of the box that I found an issue like always showing some results at the start of the searching).

In terms of your feature, routing is a really unique thing that can work completely different througout the projects. The idea behind having a module is to take a bit of generic work from the user so that they can focus on the customization and adjusting the functionality instead of writing it from scratch (take the repetable work from the user).

About what should be added. As I am the core maintainer, I am mainly proposing some ideas based on the usage of the module and also from the feedback from the users that are using the module.

I hope that I have answered your question :)

You can always create a discussion on a feature so that both me and the community members could share their feedback and interest in this feature.

Baroshem commented 2 years ago

Closing as there was no demand from other module users. If there will be a request for that, the issue can be reopen 🙂