Skip to content

feat: support react-native#2812

Closed
jbroma wants to merge 13 commits intomodule-federation:mainfrom
jbroma:feat/react-native-support
Closed

feat: support react-native#2812
jbroma wants to merge 13 commits intomodule-federation:mainfrom
jbroma:feat/react-native-support

Conversation

@jbroma
Copy link
Copy Markdown
Member

@jbroma jbroma commented Jul 30, 2024

Description

  • - added separate loadScript and createScript methods for React Native
  • - added checks for node and RN environment
  • - unified CreateScriptHook typing

in node env we check for process.versions.node (source)
in RN we check for global.navigator which is set during initialisation of React Native core (source)

right now the whole loading process is handled internally through Re.Pack

Related Issue

#2811

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
Copy Markdown

changeset-bot bot commented Jul 30, 2024

⚠️ No Changeset found

Latest commit: 00bd6ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 30, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 00bd6ea
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/66bdb5dcbb48be0008d1c2e8
😎 Deploy Preview https://deploy-preview-2812--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.

@jbroma jbroma marked this pull request as ready for review July 30, 2024 17:45
remoteInfo: this.remoteInfo,
remoteEntryExports: this.remoteEntryExports,
createScriptHook: (url: string, attrs: any) => {
createScriptHook: (url, attrs) => {
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.

was this because we have a implicit dependency ts lint rule? if not why were the typings dropped?

Copy link
Copy Markdown
Member Author

@jbroma jbroma Jul 31, 2024

Choose a reason for hiding this comment

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

typing comes from getRemoteEntry type which was modified now, so these typings became redundant

@2heal1
Copy link
Copy Markdown
Member

2heal1 commented Aug 1, 2024

The runtime and sdk unit test failed and need to be fixed.
You can execute the follow scripts to reproduce:

  • nx test runtime
  • nx test sdk

@jbroma
Copy link
Copy Markdown
Member Author

jbroma commented Aug 1, 2024

@2heal1 tests fixed 🎉

I've added a more strict check for node env to account for that.

@2heal1
Copy link
Copy Markdown
Member

2heal1 commented Aug 5, 2024

The content is no problem , but i think we should put the loadEntry into hook in case of the runtime code size become bigger with the more target supports .

For my thought , we can add a loaderHook named like loadEntry . And split getRemoteEntry into different runtime plugins which will call loadEntry hook .

Can you help to implement this ? If not, I will implement it next week and then merge this pr .

@jbroma
Copy link
Copy Markdown
Member Author

jbroma commented Aug 5, 2024

The content is no problem , but i think we should put the loadEntry into hook in case of the runtime code size become bigger with the more target supports .

For my thought , we can add a loaderHook named like loadEntry . And split getRemoteEntry into different runtime plugins which will call loadEntry hook .

Can you help to implement this ? If not, I will implement it next week and then merge this pr .

Sure thing! What's the correct place for these runtime plugins to exist in the repo? Do we keep them in SDK?

@2heal1
Copy link
Copy Markdown
Member

2heal1 commented Aug 5, 2024

The content is no problem , but i think we should put the loadEntry into hook in case of the runtime code size become bigger with the more target supports .
For my thought , we can add a loaderHook named like loadEntry . And split getRemoteEntry into different runtime plugins which will call loadEntry hook .
Can you help to implement this ? If not, I will implement it next week and then merge this pr .

Sure thing! What's the correct place for these runtime plugins to exist in the repo? Do we keep them in SDK?

Much appreciate ! The plugin can be placed in runtime/plugins and re-export as subpath

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2024

Stale pull request message

@ScriptedAlchemy
Copy link
Copy Markdown
Member

Bump

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 4, 2025

Stale pull request message

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2025

Stale pull request message

@jbroma
Copy link
Copy Markdown
Member Author

jbroma commented Mar 19, 2025

Closing this in favor of #3605

@jbroma jbroma closed this Mar 19, 2025
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.

4 participants