playwright/packages/playwright-core/src/server/injected
João Neves 7e6e5f0706
feat: Support React forwards refs and memo (#23262)
This PR fixes the react selector behavior to support components that are
wrapped by the memo or forwardRef React builtin functions.

Previously these components couldn't be selected. This PR fixes that
behavior, enabling selecting those components.

Current behavior:
```
const Foo = memo(() => <div id="foo_component" />);
Foo.displayName = "Foo";
...
playwright.$("_react=Foo") -> undefined
```

Fixed behavior:
```
const Foo = memo(() => <div id="foo_component" />);
Foo.displayName = "Foo";
...
playwright.$("_react=Foo") -> <div id ="foo_component" />
```
2023-05-30 17:14:47 -07:00
..
.eslintrc.js chore: implement pick locator in trace viewer (#20965) 2023-02-17 11:19:53 -08:00
consoleApi.ts chore: have type modifiers directly on file import (#23337) 2023-05-30 21:11:35 +02:00
DEPS.list chore: flatten supplements (#13437) 2022-04-08 12:52:40 -07:00
domUtils.ts chore: implement pick locator in trace viewer (#20965) 2023-02-17 11:19:53 -08:00
highlight.ts fix: trace viewer with global applied background-color (#23362) 2023-05-30 17:58:29 +02:00
injectedScript.ts feat(screenshot): Add customizable color option for masked elements (#23185) 2023-05-22 18:44:44 -07:00
layoutSelectorUtils.ts feat(locator): layout options (leftOf, rightOf, above, below, near) (#13821) 2022-05-03 10:33:33 +01:00
reactSelectorEngine.ts feat: Support React forwards refs and memo (#23262) 2023-05-30 17:14:47 -07:00
README.md chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
recorder.ts chore: have type modifiers directly on file import (#23337) 2023-05-30 21:11:35 +02:00
roleSelectorEngine.ts chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
roleUtils.ts fix(role): fix native controls text alternative when aria-labelledby is present (#22800) 2023-05-03 16:09:08 -07:00
selectorEngine.ts chore: refactor code around text selectors (#19278) 2022-12-05 14:08:54 -08:00
selectorEvaluator.ts feat: Locator.or(locator) (#21884) 2023-03-22 15:28:59 -07:00
selectorGenerator.ts chore: have type modifiers directly on file import (#23337) 2023-05-30 21:11:35 +02:00
selectorUtils.ts chore: have type modifiers directly on file import (#23337) 2023-05-30 21:11:35 +02:00
utilityScript.ts chore: make evaluate work with busted Array.prototype.map/push (#22528) 2023-04-21 19:52:13 +02:00
vueSelectorEngine.ts chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
xpathSelectorEngine.ts chore: fix xpath-in-iframe (#21367) 2023-03-03 09:13:25 -08:00

Injected

This directory contains helper sources which are injected into the page.

These sources are bundled with webpack to src/generated to be used as a compile-time source constants. See *.webpack.config.js for configs.