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

(BREAKING) feat: make wrapper option compatible with RTL/RNTL #399

Merged
merged 3 commits into from
Apr 25, 2023

Conversation

mdjastrzebski
Copy link
Member

Summary

Currently the wrapper option accepts a wrapping function:

(node: React.ReactElement) => JSX.Element;

However, both RNTL and RTL accept a wrapper component type:

wrapper?: React.ComponentType<any>;

Each approach can be relatively easy transformed to the other one, but having slightly different wrapper types make adapting tests from RNTL, RTL slightly more cumbersome.

This is a breaking change, but since we are pre 1.0 version it should result in minor version change (probably 0.9.0).

Test plan

Added test that checks if the wrapper is placed in the proper place in the element tree.

@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2023

🦋 Changeset detected

Latest commit: 038f41f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@callstack/reassure-measure Minor
reassure Minor
@callstack/reassure-cli Minor

Not sure what this means? Click here to learn what changesets are.

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

@mdjastrzebski mdjastrzebski changed the title (BRAKING) feat: make wrapper option compatible with RTL/RNTL (BREAKING) feat: make wrapper option compatible with RTL/RNTL Apr 24, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2023

Performance Comparison Report

  • Current: 634cb98 - 2023-04-25 12:38:11Z
  • Baseline: main (e6704f4) - 2023-04-25 12:37:32Z

Significant Changes To Render Duration

Name Render Duration Render Count
Other Component 10 146.0 ms → 139.3 ms (-6.7 ms, -4.6%) 4 → 4
Other Component 20 154.7 ms → 145.8 ms (-8.9 ms, -5.8%) 🟢 4 → 4
Other Component 10 legacy scenario 159.7 ms → 142.8 ms (-16.9 ms, -10.6%) 🟢 4 → 4
Show details
Name Render Duration Render Count
Other Component 10 Baseline
Mean: 146.0 ms
Stdev: 8.2 ms (5.6%)
Runs: 160 157 149 148 148 143 142 141 139 133

Current
Mean: 139.3 ms
Stdev: 6.4 ms (4.6%)
Runs: 147 146 144 143 141 140 137 135 134 126
Baseline
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4

Current
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4
Other Component 20 Baseline
Mean: 154.7 ms
Stdev: 9.0 ms (5.8%)
Runs: 174 167 167 162 161 160 159 158 158 156 154 150 150 149 148 147 147 145 142 140

Current
Mean: 145.8 ms
Stdev: 10.1 ms (6.9%)
Runs: 167 165 162 156 150 149 148 147 144 143 143 142 142 141 141 138 138 136 132 131
Baseline
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

Current
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
Other Component 10 legacy scenario Baseline
Mean: 159.7 ms
Stdev: 10.7 ms (6.7%)
Runs: 171 170 169 167 163 159 159 152 149 138

Current
Mean: 142.8 ms
Stdev: 3.8 ms (2.6%)
Runs: 149 147 145 144 144 142 141 141 138 137
Baseline
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4

Current
Mean: 4
Stdev: 0 (0.0%)
Runs: 4 4 4 4 4 4 4 4 4 4

Meaningless Changes To Render Duration

Show entries
Name Render Duration Render Count
Async Component 238.5 ms → 242.7 ms (+4.2 ms, +1.8%) 7 → 7
Show details
Name Render Duration Render Count
Async Component Baseline
Mean: 238.5 ms
Stdev: 9.2 ms (3.8%)
Runs: 255 248 244 240 239 238 236 232 230 223

Current
Mean: 242.7 ms
Stdev: 14.2 ms (5.8%)
Runs: 261 259 258 255 241 238 231 231 227 226
Baseline
Mean: 7
Stdev: 0 (0.0%)
Runs: 7 7 7 7 7 7 7 7 7 7

Current
Mean: 7
Stdev: 0 (0.0%)
Runs: 7 7 7 7 7 7 7 7 7 7

Changes To Render Count

There are no entries

Added Scenarios

There are no entries

Removed Scenarios

There are no entries

Generated by 🚫 dangerJS against 038f41f

@thymikee
Copy link
Member

cc @vnovick you'll like it :)

@thymikee
Copy link
Member

Let's make sure all examples are updated

Base automatically changed from fix/not-measure-wrapper to main April 24, 2023 15:19
@mdjastrzebski mdjastrzebski force-pushed the feat/wrapper-compat-with-rtl-rntl branch from 54d8208 to 3f06aab Compare April 24, 2023 16:58
@mdjastrzebski
Copy link
Member Author

@thymikee there aren't any examples using it 🤣

@mdjastrzebski mdjastrzebski merged commit baf90de into main Apr 25, 2023
@mdjastrzebski mdjastrzebski deleted the feat/wrapper-compat-with-rtl-rntl branch April 25, 2023 12:43
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.

2 participants