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

Add useCustomLocator() for non-DOM locators #302

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Alloyed
Copy link
Contributor

@Alloyed Alloyed commented Apr 8, 2024

All DOM-specific parts of the existing locator have been moved into their own folder, DOMLocator. existing calls to useLocator() will continue to use the DOM locator, but as an opt-in you can provide a custom locator with the same API as the DOM locator. The types your custom locator are expected to match can be found at locator/types.ts.

All DOM-specific parts of the existing locator have been moved into
their own folder, DOMLocator. existing calls to `useLocator()` will
continue to use the DOM locator, but as an opt-in you can provide a
custom locator with the same API as the DOM locator. The types your
custom locator are expected to match can be found at `locator/types.ts`.
Copy link

changeset-bot bot commented Apr 8, 2024

⚠️ No Changeset found

Latest commit: 5463a46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


export type {LocationAttr, LocatorComponent, TargetIDE, TargetURLFunction} from './find-components'

export type LocatorOptions = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not make LocatorOptions DOM-agnostic without changing the api. targetIDE is fine, but key assumes the browser's implementation of keyboard keys


// TODO: rename or remove?
// this is used externally so any change is a change in API
export type {LocatorOptions} from './DOMLocator/types'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If breaking changes are OK I would maybe rename this to DOMLocatorOptions

@Alloyed Alloyed marked this pull request as ready for review April 8, 2024 19:21
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

Successfully merging this pull request may close these issues.

1 participant