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

Feedback #3

Open
Haroenv opened this issue Nov 20, 2019 · 1 comment
Open

Feedback #3

Haroenv opened this issue Nov 20, 2019 · 1 comment

Comments

@Haroenv
Copy link
Contributor

Haroenv commented Nov 20, 2019

Hi! I like the idea of this package a lot. Since I work on InstantSearch I noticed some thing you decided to do differently, so I'll note here what I noticed. Feel free to just close or take it into account.

  1. algoliasearch is a peer dependency

This avoids you coupling with a certain version of the client, which is cool, but also has no real clear warning. I would suggest this instead:

<AlgoliaPlaces searchClient={algoliasearch(xxx)} />

This will also make it easier for people who are using a custom client, or later a different major version of the client.

  1. hitTransformer naming

In InstantSearch we call this transformItems. No big deal, but maybe you want to align on that

  1. search only on second character

This seems to be done on purpose, however it surprised me. I searched a few times for single characters before realising only the second one was taken in account

  1. demo

I like to try things out live when I see a package. You can add a folder in the project with an example (doesn't need to be more complex than https://codesandbox.io/s/bold-mccarthy-ljh22). Then you can link to https://codesandbox.io/s/github/tree/master/xxx-name-of-your-folder

  1. API

I see you're using modern React API like hooks. I think that gives a nice API too:

const {
 clear,
    error,
    loading,
    options,
    getInputProps,
    getOptionProps,
} = usePlaces({searchClient: algoliasearch(...), ...otherOptions });
  1. React has a wrong peer dependency

Hooks were introduced in 16.8.0, so that should be the peerDependency instead, I'll make a PR for that. EDIT: I misread 16.11.0 as 16.1.0

Have a nice day!

@RusinovAnton
Copy link
Contributor

Hi @Haroenv! This feedback is really precious, I will make sure that these points get addressed. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants