Skip to content

Decide what to do with getQueriesForElement and within #471

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

Closed
NMinhNguyen opened this issue Mar 7, 2020 · 5 comments
Closed

Decide what to do with getQueriesForElement and within #471

NMinhNguyen opened this issue Mar 7, 2020 · 5 comments

Comments

@NMinhNguyen
Copy link
Contributor

NMinhNguyen commented Mar 7, 2020

Describe the feature you'd like:

Decide whether to keep both getQueriesForElement and within. I spoke to @kentcdodds on Twitter and he thinks that perhaps we should keep both. He suggested that I create an issue to discuss.

If both are kept, perhaps the docs could be improved to help people decide between the two.

Suggested implementation:

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@kentcdodds
Copy link
Member

I'd love to hear from other people. I'm not a fan of two ways to do the same thing (which is all aliases are), but I kind of like the way it reads in the different situations people use them in:

  • getQueriesForElement: used by framework integration libraries
  • within: used by users who want to scope some queries within an element (like a modal).

@NMinhNguyen
Copy link
Contributor Author

What about the third though, bindElementToQueries? Or do you see value in it being used by framework integration libraries too?

@kentcdodds
Copy link
Member

Oh, right, whoops, I honestly totally forgot about that and didn't even bother to read it because I assumed this was talking about the within alias.

Yeah, let's get rid of bindElementToQueries 💯

@NMinhNguyen
Copy link
Contributor Author

NMinhNguyen commented Mar 8, 2020

Yeah, let's get rid of bindElementToQueries 💯

I can repurpose the issue description to talk about within and getQueriesForElement :)

Would you like to deprecate bindElementToQueries first or just remove it?

@kentcdodds
Copy link
Member

It's not been documented for a long time so I doubt anyone would be mad if we removed it. And renaming would be really trivial anyway.

@NMinhNguyen NMinhNguyen changed the title Decide what to do with bindElementToQueries Decide what to do with getQueriesForElement and within Mar 8, 2020
kentcdodds pushed a commit that referenced this issue Mar 8, 2020
Closes #471

BREAKING CHANGE: Use `getQueriesForElement` or `within` instead.
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