Skip to content

refactor(breaking): rename container to UNSAFE_root; introduce root host element - #1298

Merged
mdjastrzebski merged 11 commits into
mainfrom
refactor/container-api
Feb 13, 2023
Merged

refactor(breaking): rename container to UNSAFE_root; introduce root host element#1298
mdjastrzebski merged 11 commits into
mainfrom
refactor/container-api

Conversation

@mdjastrzebski

Copy link
Copy Markdown
Member

Summary

This PR contains breaking changes behind useBreakingChanges feature flag.

Resolves #1296

  1. Rename container to UNSAFE_root
  2. Display deprecation messages for container (behind useBreakingChanges )
  3. Expose root API that returns root host element.

Test plan

All tests pass.

@mdjastrzebski
mdjastrzebski requested review from AugustinLF, MattAgn, pierrezimmermannbam and thymikee and removed request for AugustinLF January 27, 2023 14:33
@thymikee thymikee changed the title refactor: fix container API refactor(breaking): rename container to UNSAFE_root; introduce root host element Jan 27, 2023
Comment thread src/__tests__/__snapshots__/render.breaking.test.tsx.snap Outdated
Comment thread src/__tests__/render.breaking.test.tsx Outdated
Comment thread src/render.tsx Outdated
Comment thread src/screen.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this type accurate? Isn't there a narrower type for host elements?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

unfortunately no, though we might think about something like that in the future

Comment thread src/render.tsx Outdated
@mdjastrzebski
mdjastrzebski force-pushed the refactor/container-api branch from 205d266 to f842f8b Compare January 28, 2023 21:46
Comment thread website/docs/API.md Outdated
Comment thread website/docs/API.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel like it could be interesting to give more indications on what we think are good use cases for this api (e.g. asserting an element is not rendered) because I don't think it's very intuitive how to use this

@codecov

codecov Bot commented Feb 13, 2023

Copy link
Copy Markdown

Codecov Report

Base: 96.07% // Head: 96.09% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (8597706) compared to base (1e8b3ba).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
+ Coverage   96.07%   96.09%   +0.02%     
==========================================
  Files          49       49              
  Lines        3308     3333      +25     
  Branches      497      503       +6     
==========================================
+ Hits         3178     3203      +25     
  Misses        130      130              
Impacted Files Coverage Δ
src/render.tsx 100.00% <100.00%> (ø)
src/screen.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mdjastrzebski
mdjastrzebski merged commit 47b125c into main Feb 13, 2023
@mdjastrzebski
mdjastrzebski deleted the refactor/container-api branch February 13, 2023 23:32
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.

RFC: re-write container API

4 participants