Skip to content

Commit

Permalink
chore: add comments to example (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadaraUchiha-314 authored Jun 26, 2024
1 parent 26977b1 commit f429af4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/examples/project-a/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/* eslint-disable import/no-unresolved */
/* 'react' is shared and declared as eager. Hence it will be bundled as part of the remote entry. */
import React, { Component, useMemo } from 'react';
/* 'uuid' is shared. */
import { v4 as uuidv4 } from 'uuid';

/* eslint-disable-next-line import/no-unresolved */
/* project-b is another federated remote. button is an exposed module from that federated remote */
import Button, { someThingElse } from 'project-b/button';
/* eslint-disable-next-line import/no-unresolved */
/* project-b is another federated remote. link is an exposed module from that federated remote */
import Link, { someThingDifferent } from 'project-b/link';

/* Import from a local file. */
import { ABC } from './abc.js';

/* 'redux' is shared. Example shows that "export" syntax also works */
export { createStore, compose } from 'redux';
export { applyMiddleware as kindlyApplyMiddleware } from 'redux';

Expand All @@ -18,11 +23,13 @@ export async function doSomething() {
console.log('React version is: ', React.version);
console.log('typeof React.Component is: ', typeof Component);
console.log(useMemo);
/* 'react-dom' is shared. */
const ReactDOM = await import('react-dom');

console.log('ReactDOM version is: ', ReactDOM.version);
console.log('A random uuid for you: ', uuidv4());
console.log('ABC = ', ABC);
/* './pqr' is an exposed module of this container */
const { PQR } = await import('./pqr.js');
console.log('PQR = ', PQR);

Expand All @@ -46,3 +53,5 @@ export async function doSomething() {
}

/* eslint-enable no-console */
/* eslint-disable import/no-unresolved */

0 comments on commit f429af4

Please sign in to comment.