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

chore: remove unnecessary window.postMessage for W3mFrame #2658

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Aug 6, 2024

Description

This PR removes unnecessary window.postMessage call over W3mFrame when sending a message for secure site.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections

Copy link

vercel bot commented Aug 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Aug 14, 2024 3:03pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Aug 14, 2024 3:03pm

@@ -124,7 +124,6 @@ export class W3mFrame {
throw new Error('W3mFrame: iframe is not set')
}
W3mFrameSchema.appEvent.parse(event)
window.postMessage(event)
this.iframe.contentWindow.postMessage(event, '*')
Copy link
Contributor

Choose a reason for hiding this comment

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

@zoruka Is it because the this.iframe.contentWindow.postMessage(event, '*') does the thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, exactly!

Copy link
Contributor

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 71.88% 2342 / 7907
🔵 Statements 71.88% 2342 / 7907
🔵 Functions 108.57000000000001% 178 / 611
🔵 Branches 138.92999999999998% 293 / 670
File CoverageNo changed files found.
Generated in workflow #5596

Copy link
Contributor

♻️ Vite-Size ♻️

Size Difference

Size (kb) Gzip (kb)
Total Diff. 0 0

Current Size

Name Size (kb) Gzip (kb)
assets/index-PFfGxlpC.js 1648.959 459.81
assets/w3m-modal-BhjJua6O.js 6.856 2.476
assets/ccip-CgPdMndm.js 3.029 1.38
assets/index-NLjrI1MQ.js 9.39 3.338
assets/index-BMN96YZE.js 11.55 3.196
assets/index-DLJ0wgz8.js 102.257 29.121
assets/index-ISrKIkaL.js 161.649 59.485
assets/index-Cn3dPEEY.js 112.437 34.332
assets/hooks.module-DWPGzd8Y.js 77.551 26.505
assets/index-CelnN-IK.js 304.097 87.219
index.html 0.329 0.236
Total Size 2438.104 707.098

Base Size

Name Size (kb) Gzip (kb)
assets/index-PFfGxlpC.js 1648.959 459.81
assets/ccip-CgPdMndm.js 3.029 1.38
assets/index-BMN96YZE.js 11.55 3.196
assets/w3m-modal-BhjJua6O.js 6.856 2.476
assets/hooks.module-DWPGzd8Y.js 77.551 26.505
assets/index-NLjrI1MQ.js 9.39 3.338
assets/index-Cn3dPEEY.js 112.437 34.332
assets/index-DLJ0wgz8.js 102.257 29.121
assets/index-ISrKIkaL.js 161.649 59.485
assets/index-CelnN-IK.js 304.097 87.219
index.html 0.329 0.236
Total Size 2438.104 707.098

@zoruka zoruka merged commit acc534a into main Aug 14, 2024
12 checks passed
@zoruka zoruka deleted the fix/remove-window-post-message branch August 14, 2024 15:08
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.

3 participants