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

refac: use resize observer instead of mutation observer #1547

Merged
merged 2 commits into from Dec 5, 2022

Conversation

akellbl4
Copy link
Collaborator

@akellbl4 akellbl4 commented Dec 4, 2022

Refactor resizing mechanism with more sutable browser API.

@akellbl4 akellbl4 changed the title refac: use resize observer instead mutation observer refac: use resize observer instead of mutation observer Dec 4, 2022
const observer = new ResizeObserver(updateIframeHeight);

updateIframeHeight();
observer.observe(document.body);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if it's a good idea to listen on body.

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

size-limit report 📦

Path Size
public/embed.mjs 2.03 KB (0%)
public/remark.mjs 72.67 KB (-0.2% 🔽)
public/remark.css 8.12 KB (-0.02% 🔽)
public/last-comments.mjs 35.65 KB (+0.01% 🔺)
public/last-comments.css 3.72 KB (-0.03% 🔽)
public/deleteme.mjs 12.05 KB (0%)
public/counter.mjs 749 B (0%)

@codecov
Copy link

codecov bot commented Dec 4, 2022

Codecov Report

Base: 58.04% // Head: 58.02% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (9d7a807) compared to base (68b8468).
Patch coverage: 59.09% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1547      +/-   ##
==========================================
- Coverage   58.04%   58.02%   -0.03%     
==========================================
  Files         131      131              
  Lines        2920     2911       -9     
  Branches      746      743       -3     
==========================================
- Hits         1695     1689       -6     
+ Misses       1093     1091       -2     
+ Partials      132      131       -1     
Impacted Files Coverage Δ
...ark42/app/components/comment-form/comment-form.tsx 51.70% <ø> (-0.24%) ⬇️
...rontend/apps/remark42/app/components/root/root.tsx 0.00% <0.00%> (ø)
frontend/apps/remark42/app/utils/post-message.ts 50.00% <ø> (ø)
...apps/remark42/app/components/textarea-autosize.tsx 88.88% <84.61%> (-1.59%) ⬇️
...nd/apps/remark42/app/components/auth/auth.hooks.ts 91.02% <100.00%> (-1.29%) ⬇️

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.

@umputun umputun merged commit 8d95baa into master Dec 5, 2022
@umputun umputun deleted the akellbl4/refactor-resizing branch December 5, 2022 18:03
@paskal paskal added this to the v1.11.2 milestone Dec 14, 2022
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.

None yet

4 participants