Skip to content

Commit

Permalink
feat(react): add nodeSrc prop to FeatureAppLoader (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable authored and clebert committed Nov 28, 2018
1 parent bf73c5c commit af65f4f
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 51 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ singleton instance to render their Feature App.
#### The React Feature App Loader

With the React `FeatureAppLoader` a Feature App can be loaded and rendered by
defining the URL to its JavaScript UMD bundle, e.g.:
defining a `src` which is the URL to its JavaScript UMD bundle, e.g.:

```js
import {FeatureAppLoader} from '@feature-hub/react';
Expand All @@ -190,6 +190,22 @@ import {FeatureAppLoader} from '@feature-hub/react';
/>
```

Additionally, when a Feature App wants to be rendered on the server, its
`nodeSrc` must be specified, which is the URL to its CommonJS bundle (targeted
at Node.js):

```jsx
<FeatureAppLoader
manager={manager}
src="https://example.com/my-feature-app.js"
nodeSrc="https://example.com/my-feature-app-node.js"
/>
```

**Note:** Server-side rendering of Feature Apps is not fully supported yet. See
our [roadmap](https://github.com/sinnerschrader/feature-hub/milestone/3) for
details.

You can also define a `css` prop to add stylesheets to the document.

```jsx
Expand Down
2 changes: 1 addition & 1 deletion docs/api/@feature-hub/react/assets/js/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit af65f4f

Please sign in to comment.