Skip to content

Commit

Permalink
updated: readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jul 30, 2023
1 parent 64b2496 commit e1a41e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const html = render('my-component', MyComponent, { some: 'initial props' })

_Important_ If you want to import raw `.riot` components in your application you might want to [read this](https://github.com/riot/ssr#register---to-load-riot-components-in-node)

_Notice_ that components rendered on the server will **always automatically receive the `isServer=true` property**.
_Note_ that components rendered on the server will **always automatically receive the `isServer=true` property**.

### renderAsync - to handle asynchronous rendering

Expand Down Expand Up @@ -204,25 +204,6 @@ console.log(global.window, global.document)
domGlobals.clear()
```

### register - to load riot components in node

If you only want to load directly your `riot` components in your node application you might have a look at [`@riotjs/register`](https://github.com/riot/register)
For example:

```js
import register from '@riotjs/register'

import MyComponent from './my-component.riot' // It will fail

// from now on you can load `.riot` tags in node
const unregister = register()

import MyComponent from './my-component.riot' // it works!

// normally you will not need to call this function but if you want you can unhook the riot loader
unregister()
```

#### Caveat

If you are rendering your whole HTML you will not be able to use multiple times the inline `<script>` `<style>` tags.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@riotjs/ssr",
"version": "8.1.2",
"version": "9.0.0",
"type": "module",
"description": "Riot module to render riot components on the server",
"main": "index.cjs",
Expand Down

0 comments on commit e1a41e7

Please sign in to comment.