Skip to content

Conversation

@2heal1
Copy link
Member

@2heal1 2heal1 commented Nov 4, 2024

Description

use document.defaultView to get real window object to solve csp issue

Related Issue

#3108

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2024

🦋 Changeset detected

Latest commit: b5c9917

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

This PR includes changesets to release 24 packages
Name Type
@module-federation/runtime Patch
@module-federation/devtools Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/retry-plugin Patch
@module-federation/runtime-tools Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/enhanced Patch
@module-federation/modern-js Patch
@module-federation/rspack Patch
@module-federation/rsbuild-plugin Patch
@module-federation/modernjsapp Patch
@module-federation/sdk Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch

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

@netlify
Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit b5c9917
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/672834def0924e0008274d30
😎 Deploy Preview https://deploy-preview-3163--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@squadronai squadronai bot left a comment

Choose a reason for hiding this comment

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

Summary

This pull request fixes a runtime issue by using document.defaultView to get the real window object, which helps solve a CSP (Content Security Policy) issue. The change ensures the correct global object is used, particularly in cases where the code is running in a sandbox environment. The pull request includes updated tests and documentation, ensuring the fix is thoroughly tested and documented.

File Summaries
File Summary
packages/runtime/src/global.ts The code changes introduce a fix to use document.defaultView to get the real window object, which helps solve a CSP (Content Security Policy) issue. This change is made to ensure the correct global object is used, particularly in cases where the code is running in a sandbox environment.

Copy link
Contributor

@squadronai squadronai bot left a comment

Choose a reason for hiding this comment

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

Incremental Review

Comments posted: 4

Configuration

Squadron Mode: essential

Commits Reviewed

f7791881772a7e7dfd21508a13fcb9190e21b6c3...b5c9917ffba7da12fb175dfdee5adcfa0ddf1e18

Files Reviewed
  • packages/runtime/src/global.ts
Files Ignored

These files were ignored due to the filter in the squadron.yaml file.

  • .changeset/cyan-emus-prove.md

@module-federation module-federation deleted a comment from squadronai bot Nov 4, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 4, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 4, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 4, 2024
@2heal1 2heal1 merged commit 54bfd1c into main Nov 5, 2024
19 checks passed
@2heal1 2heal1 deleted the fix/csp branch November 5, 2024 02:25
@2heal1 2heal1 mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants