Uh oh!
There was an error while loading. Please reload this page.
refactor(v13): remove detect host component names - #1697
Conversation
thymikee
commented
Oct 31, 2024
Would be great to get rid of that indirection between incomplete RN core mocks and RNTL |
mdjastrzebski
commented
Nov 4, 2024
RN mocks are a bigger topic that has to be coordinated closely with the RN team, as the mocks reside in the RN repo. Moreover, any changes to mock level/structure can potentially make user test bases fail. In the due time (~ RNTL v14 with the new renderer) I plan to prepare an RFC to RN core team about recommended mock changes. |
pierrezimmermannbam
left a comment
There was a problem hiding this comment.
I completely agree on this, this library is anyway coupled with RN mocks so it feels like unnecessary complexity in the end
rtrembecky
commented
Nov 5, 2024
hi, just a quick feedback that this is missing from the v13.0.0-alpha.1 release notes, not sure if intended. I'm eager to try it to see tests performance impact |
mdjastrzebski
commented
Nov 5, 2024
@rtrembecky good catch. Added it. I would appreciate any feedback on v13 in your project: migration, broken tests, perf 🙏 |
rtrembecky
commented
Nov 5, 2024
I've done a very quick testing on test suite of one of our RN libs - it went through fine. but unfortunately I didn't see any noticeable performance gain, which is what I'm currently interested in. (the biggest culprits for us are probably barrel files and transformation of RN flow-typed files... not related to this issue) |
mdjastrzebski
commented
Nov 5, 2024
@rtrembecky Hmmm, that's a bit weird. I would expecte 10-20% speed improvement as in #1579. Can you share some stats? Total run time before/after, number of tests, etc? |
mdjastrzebski
commented
Nov 5, 2024
Here are the stats for RNTL own test base Before (7905bb5): After (13bc78a): |
rtrembecky
commented
Nov 5, 2024
running a single RN test on my M1 Max takes 35s even it it's skipped, saying something about our setup - I think it's the barrel files handling (jestjs/jest#11234), so RNTL performance is most probably overshadowed. I will definitely come back, if I manage to solve this, to report the performance impact. |
Summary
Remove host component name detection for v13+ release. Instead we hardcode the expected host component names & add relevant tests to make sure our
isHostXxxfunction work correctly for RN components.Rationale:
RCTView/RCTTexttoView/Text. In reality that past change wasn't only about the name, but also the level at which components are mocked, as the new mocks no longer execute JS code for View, Text.aria-*props names, or handling pressability forText/TextInput, as that part of the code got removed by the RN mocks. Therefore, potentially any RN mocks change will result in RNTL needing to adapt to these changes beyond the name.Test plan
All tests should pass.