Giter Site home page Giter Site logo

valerioageno / ssr-rs Goto Github PK

View Code? Open in Web Editor NEW
88.0 3.0 8.0 1.1 MB

Server side rendering on rust servers using the v8 engine for parse and evaluate the javascript code.

Home Page: https://docs.rs/ssr_rs

License: Apache License 2.0

Rust 100.00%
ssr react reactjs actix-web rust-servers rust render rust-ssr v8-engine javascript

ssr-rs's People

Contributors

auspicus avatar valerioageno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssr-rs's Issues

example `tide` bug

thanks for amazing work.
however, there are errors when runing example tide
the src:

...
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/styles/*").serve_dir("client/dist/ssr/styles/")?;
    app.at("/images/*").serve_dir("client/dist/ssr/images/")?;
    app.at("/scripts/*").serve_dir("client/dist/client/")?;
    app.at("/*").get(return_html);
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}
...

It should be:

...
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/styles/").serve_dir("client/dist/ssr/styles/")?;
    app.at("/images/").serve_dir("client/dist/ssr/images/")?;
    app.at("/scripts/").serve_dir("client/dist/client/")?;
    app.at("/").get(return_html);
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}
...

RsPack Example?

Thanks for the project. Are you able to provide an example using Rspack? It is supposed to have equiv API to webpack, but I have been experimenting with various options, but can't seem to get the output configuration right for an IIFE variable entrypoint using the same output configuration from the webpack example configuration as a foundation. TBH the iife output flag didn't make any difference when using named variable output. Here is a sample of the rspack output (I simplified the render function to simply return a string without React rendering):

var SSR;!function(){var e={512:function(e,t,n){"use strict";n.r(t),n.d(t,{Index:function(){return r}});var r=function(e){return'<!doctype html>\n  <html>\n    <head>\n      <title>React SSR</title>\n      <link rel="stylesheet" href="./styles/ssr.css">\n      <\/script>\n    </head>\n    <body>\n    <h1>React SSR</h1>\n    </body>\n  </html>'}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},SSR=n("512")}();

With all of my experiments, I received "failed to call function". Any pointers will be appreciated.

README and documentation are dated

Hey @Valerioageno!

Thanks for your excellent package. Looks like the documentation and the README are a bit dated?

  • Looks like the API has changed and you don't need to call ::new() anymore?
  • Seems that rusty_v8 is not used anymore and you're using v8 directly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.