3.1.8 • Published 2 years ago

@harlem/plugin-ssr v3.1.8

Weekly downloads
24
License
MIT
Repository
github
Last release
2 years ago

Harlem Server-Side Rendering Plugin

The SSR plugin adds support for using Harlem in a Vue server-side rendered application.

Installation

Before installing the ssr plugin make sure you have installed harlem.

yarn add @harlem/plugin-ssr
# or
npm install @harlem/plugin-ssr

Usage

Server

Create an instance of the plugin and register it with Harlem on the server:

import App from './app.vue';

import {
    createVuePlugin
} from 'harlem';

import {
    createServerSSRPlugin
} from '@harlem/plugin-ssr';

createSSRApp(App)
    .use(createVuePlugin({
        plugins: [
            createServerSSRPlugin()
        ]
    }));

Generate the bridging script block and insert it into the server-rendered content:

import {
    renderToString
} from '@vue/server-renderer';

import {
    getBridgingScriptBlock
} from '@harlem/plugin-ssr';

let output = await renderToString(app);
output += getBridgingScriptBlock();

Client

Create an instance of the plugin and register it with Harlem on the client:

import App from './app.vue';

import {
    createVuePlugin
} from 'harlem';

import {
    createClientSSRPlugin
} from '@harlem/plugin-ssr';

createApp(App)
    .use(createVuePlugin({
        plugins: [
            createClientSSRPlugin()
        ]
    }));

Types that are not support by JSON serialisation will not be transferred from server to client. See the MDN documentation on JSON serialisation for more information: MDN docs

3.1.8

2 years ago

3.1.7

2 years ago

3.1.6

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.1.5

2 years ago

3.1.4

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

2.4.0-beta.11

3 years ago

2.4.0-beta.10

3 years ago

3.0.0

3 years ago

3.0.0-beta.1

3 years ago

3.0.0-beta.0

3 years ago

2.4.0-beta.8

3 years ago

2.4.0-beta.7

3 years ago

2.4.0-beta.9

3 years ago

2.4.0-beta.4

3 years ago

2.4.0-beta.6

3 years ago

2.4.0-beta.5

3 years ago

2.3.8

3 years ago

2.3.7

3 years ago

2.3.9

3 years ago

2.4.0-beta.3

3 years ago

2.4.0-beta.2

3 years ago

2.4.0-beta.1

3 years ago

2.3.6

3 years ago

2.3.5

3 years ago

2.3.2

3 years ago

2.3.3

3 years ago

2.3.0

3 years ago

2.3.1

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

4 years ago

2.1.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-beta.9

4 years ago

2.0.0-beta.8

4 years ago

2.0.0-beta.7

4 years ago

2.0.0-beta.10

4 years ago

2.0.0-beta.6

4 years ago

2.0.0-beta.5

4 years ago

2.0.0-beta.4

4 years ago

2.0.0-beta.3

4 years ago

2.0.0-beta.2

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

2.0.0-alpha.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.0

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.1.3

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago