Skip to content

Commit

Permalink
docs(doc): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Jun 18, 2021
1 parent fa56b71 commit 266e43b
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,7 @@ const { createWebpackConfig } = require('fronts-bundler');
module.exports = createWebpackConfig(originalWebpackConfig);
```

3. Load `app1/src/App.jsx` with `useApp()` to import `app2`.

```jsx
import React from 'react';
import { useApp } from 'fronts-react';

export const App = () => {
const App2 = useApp({
name: 'app2',
loader: () => import('app2/src/bootstrap'),
});
return <App2 />;
};
```

4. Define the default exported bootstrap function in `app2/src/bootstrap.jsx` and use `boot()` to get it booted.
3. Define the default exported bootstrap function in `app2/src/bootstrap.jsx` and use `boot()` to get it booted.

```jsx
import React from 'react';
Expand All @@ -117,6 +102,25 @@ export default function render(element) {
boot(render, document.getElementById('root'));
```

4. Load `app1/src/App.jsx` with `useApp()` to import `app2`.

```jsx
import React from 'react';
import { useApp } from 'fronts-react';

export const App = () => {
const App2 = useApp({
name: 'app2',
loader: () => import('app2/src/bootstrap'),
});
return <App2 />;
};
```

## Examples

- [Simple Example](https://github.com/unadlib/fronts-example)

## APIs

| API | Isolation |
Expand Down Expand Up @@ -144,10 +148,6 @@ The most popular frontend frameworks are React, Vue and Angular. When the micro
| Module Federation | Webpack<br />site.json | Dependency Management ✅<br/> Monorepo ✅<br/> Version Management ❌ |
| Version Control | Webpack<br />site.json<br />Registry Server | Dependency Management ✅<br/> Monorepo ✅<br/> Version Management ✅ |

## Examples

- [Simple Example](https://github.com/unadlib/fronts-example)

## Debugger/Logger

Use `getMeta()`, it helps you to get the dependency mapping information.
Expand Down

0 comments on commit 266e43b

Please sign in to comment.