Skip to content

Commit

Permalink
Add svelte mention (#41)
Browse files Browse the repository at this point in the history
* Add svelte mention in README and docs.rs

* Update v8 version to v0.94.0

* update version to v0.5.5
  • Loading branch information
Valerioageno authored Jun 27, 2024
1 parent 103863e commit 357d45d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ssr_rs"
version = "0.5.4"
version = "0.5.5"
authors = ["Valerio <[email protected]>"]
edition = "2021"
description = "Server side rendering with the v8 engine for parse and evaluate the javascript code"
Expand All @@ -22,7 +22,7 @@ name = "ssr_rs"
path = "src/lib.rs"

[dependencies]
v8= "0.93.0"
v8= "0.94.0"

[dev-dependencies]

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ The crate aims to enable server side rendering on rust servers in the simplest a

It uses an embedded version of the [V8](https://v8.dev/) javascript engine (<a href="https://github.com/denoland/rusty_v8" target="_blank">rusty_v8</a>) to parse and evaluate a built bundle file and return a string with the rendered html.

> ℹ️ This project is the backbone of [tuono](https://github.com/Valerioageno/tuono); a fullstack react framework with built in server side rendering.
ℹ️ **This project is the backbone of [tuono](https://github.com/Valerioageno/tuono); a fullstack react framework with built in server side rendering.**

Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/) and [React 18](https://react.dev/) - Check the examples folder.
Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 4](https://svelte.dev/) - Check the `examples/` folder.

> Check <a href="https://github.com/Valerioageno/ssr-rs/blob/main/benches">here</a> the benchmark results.
## Getting started

Add this to your `Cargo.toml`:

```toml
[dependencies]
ssr_rs = "0.5.4"
```bash
cargo add ssr_rs
```

## Example
Expand Down Expand Up @@ -63,12 +62,12 @@ In case the bundled JS is an IIFE or the plain object the `entryPoint` is an emp
```

```javascript
// IIFE varible example | bundle.js -> See webpack-react example
// IIFE variable example | bundle.js -> See webpack-react example
var SSR = (() => ({renderToStringFn: (props) => "<html></html>"}))() // SSR is the entry point
```

```javascript
// Varible example | bundle.js -> See webpack-react example
// Variable example | bundle.js -> See webpack-react example
var SSR = {renderToStringFn: (props) => "<html></html>"}; // SSR is the entry point
```

Expand Down Expand Up @@ -158,7 +157,7 @@ Any helps or suggestions will be appreciated.

Known TODOs:
- Add examples with other rust backend frameworks
- Add examples with other frontend frameworks (i.e. vue, quik, solid, svelte)
- Add examples with other frontend frameworks (i.e. vue, quik, solid)
- Add benchmark setup to test against Deno and Bun
- Explore support for V8 snapshots
- Explore js copilation to WASM (i.e. [javy](https://github.com/bytecodealliance/javy))
Expand Down
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
//!
//! It uses an embedded version of the [V8](https://v8.dev/) javascript engine (<a href="https://github.com/denoland/rusty_v8" target="_blank">rusty_v8</a>) to parse and evaluate a built bundle file and return a string with the rendered html.
//!
//! > ℹ️ This project is the backbone of [tuono](https://github.com/Valerioageno/tuono); a fullstack react framework with built in server side rendering.
//! ℹ️ **This project is the backbone of [tuono](https://github.com/Valerioageno/tuono); a fullstack react framework with built in server side rendering.**
//!
//! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/) and [React 18](https://react.dev/) - Check the examples folder.
//! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 4](https://svelte.dev/) - Check the <a href="https://github.com/Valerioageno/ssr-rs/blob/main/examples" target="_blank">examples</a> folder.
//!
//! > Check <a href="https://github.com/Valerioageno/ssr-rs/blob/main/benches">here</a> the
//! benchmarks results.
//!
//! # Getting started
//! ```toml
//! [dependencies]
//! ssr_rs = "0.5.4"
//! ```bash
//! cargo add ssr_rs
//! ```
//!
//! # Example
Expand Down Expand Up @@ -58,12 +57,12 @@
//! ```
//! ```javascript
//! // IIFE varible example | bundle.js -> See webpack-react example
//! // IIFE variable example | bundle.js -> See webpack-react example
//! var SSR = (() => ({renderToStringFn: (props) => "<html></html>"}))() // SSR is the entry point
//! ```
//! ```javascript
//! // Varible example | bundle.js -> See webpack-react example
//! // Variable example | bundle.js -> See webpack-react example
//! var SSR = {renderToStringFn: (props) => "<html></html>"}; // SSR is the entry point
//! ```
//!
Expand Down

0 comments on commit 357d45d

Please sign in to comment.