microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.03k stars 3.54k forks source link

Respect jsxImportSource from tsconfig instead of using mock jsx implementation #26936

Open rubber-duck-software opened 11 months ago

rubber-duck-software commented 11 months ago

Currently playwright ignores whatever jsx configuration settings are used in your tsconfig and instead uses a mock implementation of jsx. This was introduced to resolve #22789. However, respecting the jsx configuration supplied in tsconfig is the better behavior. This would resolve the issue described in #26863.

Since playwright loads the tsconfig anyways, this change would be minimally invasive.

rubber-duck-software commented 8 months ago

Hi @pavelfeldman - when I first raised this issue, I was not aware the number of upvotes it received would be meaningful, so I made no effort to engage the playwright community.

Since PR #26884 was closed, I started engaging with more people on this issue. Are willing to reevaluate accepting the PR in light of 16 upvotes?

rubber-duck-software commented 4 months ago

Hey @pavelfeldman - this is the third most upvoted issue currently assigned to you. Can you give an update on your thoughts here? What can I do to get the ball rolling on this bug fix again? If I opened a new PR, would it get reviewed?

rubber-duck-software commented 4 months ago

Hey @dgozman - it looks like @pavelfeldman is not able to engage on this one for now. Would you be willing to review a PR if I opened one up again?

lo1tuma commented 1 month ago

I’ve just run into this issue as well. And it was quite hard to figure out what is going on, because the only thing I got was a react error Objects are not valid as a React child (found: object with keys {__pw_type, type, props, key}). If you meant to render a collection of children, use an array instead.

Is there any workaround available to disable the jsx mock? The only option I see at the moment is to precompile the typescript files on my own.

rubber-duck-software commented 1 month ago

@lo1tuma - as far as I know, precompiling is the only option (except for version ~1.31.0 where this briefly worked). If you find a better alternative, please let me know 🙏.