Skip to content

Conversation

@elbeezi
Copy link
Contributor

@elbeezi elbeezi commented Apr 29, 2024

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 Apr 29, 2024

⚠️ No Changeset found

Latest commit: def4a60

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

netlify bot commented Apr 29, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit def4a60
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/663402262b27b000080f1865
😎 Deploy Preview https://deploy-preview-2424--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.


### 3. Consuming the Producer

> Change the entry to be asynchronous
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that this part is necessary. Why delete it and consider it duplicate?

Copy link
Contributor Author

@elbeezi elbeezi Apr 30, 2024

Choose a reason for hiding this comment

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

This section was in the page three times, once in "Creating a Consumer" but then twice in "Creating a Producer":

> Change the entry to be asynchronous
```tsx
// Move src/index.tsx to a newly created src/bootstrap.tsx file
// src/index.tsx
import('./bootstrap');
// src/bootstrap.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
```

> Change the entry to be asynchronous
```tsx
// Move src/index.tsx to a newly created src/bootstrap.tsx file
// src/index.tsx
import('./bootstrap');
// src/bootstrap.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
```

I removed the first instance in the Producer section rather than the second, as it seemed like a cleaner sequence that way, but either one would work.

@ScriptedAlchemy
Copy link
Member

It should remain there since both apps should be in async mode.

@elbeezi
Copy link
Contributor Author

elbeezi commented Apr 30, 2024

It should remain there since both apps should be in async mode.

It's in the producer section twice, though (I referred to them backwards in my previous comment, corrected now):

Screenshot 2024-04-30 at 7 22 31 PM

@ScriptedAlchemy ScriptedAlchemy merged commit efc9c81 into module-federation:main May 2, 2024
@zhoushaw zhoushaw mentioned this pull request May 6, 2024
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