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

feat(sdk): script timeout #2433

Merged
merged 16 commits into from May 17, 2024
Merged

feat(sdk): script timeout #2433

merged 16 commits into from May 17, 2024

Conversation

ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Apr 30, 2024

Description

Allow timeout to be set on create script

Script timeout is OS based and on windows, it can take several seconds before errorLoadRemote hook can be triggered as OS waits for script

Related Issue

#2367

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.

Copy link

changeset-bot bot commented Apr 30, 2024

🦋 Changeset detected

Latest commit: 19d0306

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

This PR includes changesets to release 18 packages
Name Type
@module-federation/runtime Patch
@module-federation/sdk Patch
@module-federation/devtools Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/runtime-tools Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/dts-plugin Patch
@module-federation/enhanced Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/rspack Patch
@module-federation/utilities Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
3008-runtime-remote Patch
@module-federation/modernjs Patch
@module-federation/third-party-dts-extractor 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

Copy link

netlify bot commented Apr 30, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 19d0306
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/6647d6281bbdc60008852c76
😎 Deploy Preview https://deploy-preview-2433--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.

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review May 2, 2024 20:25
| HTMLScriptElement
| { script?: HTMLScriptElement; timeout?: number }
| void;

export function createScript(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could add a unit test here

Copy link
Member Author

Choose a reason for hiding this comment

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

I was struggling to find how to create a unit test in this case because timeout immediately throws error in simulation when remote is offline.

Do you have an idea of how to unit test this case?
Only on windows does it have the timeout problem so in browser its hard to reproduce

Copy link
Member Author

Choose a reason for hiding this comment

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

@zhoushaw tests added, i found dom.test.ts was not running at all so i have written a handful of new tests

@ScriptedAlchemy ScriptedAlchemy merged commit 103b2b8 into main May 17, 2024
9 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the feat/script-timeout branch May 17, 2024 22:24
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.

None yet

3 participants