GithubHelp home page GithubHelp logo

mackentoch / react-redux-immutable-webpack-ssr-starter Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 8.0 3.53 MB

React + React-Router 4 + Redux + ImmutableJS + Bootstrap + webpack 3 with with Server side rendering, Hot Reload and redux-devtools STARTER

JavaScript 98.80% HTML 0.20% CSS 1.01%
boilerplate bootstrap chai immutable immutablejs mocha react-bootstrap react-hot-loader-3 react-hot-loader3 reactjs redux redux-devtools ssr starter starter-project starter-template webpack webpack3

react-redux-immutable-webpack-ssr-starter's People

Contributors

mackentoch avatar

Stargazers

 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  avatar  avatar

react-redux-immutable-webpack-ssr-starter's Issues

Seems like state is not immutable

Thank you very much for the code, very useful. May be I am not getting it right, but it seems to me like the state is not immutable. look at this:

This is where you create the state to be sent to the client:

const preloadedState = serialize(store.getState().toJS()); // serialize is better than JSON.stringify

And this is where you send it:

<body class="skin-black" style="background-color:#f1f2f7">
        <section id="root"><div>${html}</div></section>
        <script type="text/javascript">window.__PRELOADED_STATE__ = ${preloadedState}</script>
        <script type="text/javascript" src="/assets/app.vendor.bundle.js"></script>
        <script type="text/javascript" src="/assets/app.bundle.js"></script>
</body>

The preloaded state it already converted from immutable to js Object using .toJS().
I though you would have converted back the state to the original immutable object.

It is easy to do with immutable's .fromJS() function, but it become complicated when the state contains Records.

I am actually struggling with the module transit-immutable-js to achieve that, but I am facing some troubles, I hoped you got an alternative.

React SSR, not showing PreloadedState..

The application running well, but SSR not working correctly.. STATE not showing after fetch data..

<script type="text/javascript">window.__PRELOADED_STATE__ = {"views":{"currentView":"not set","enterTime":null,"leaveTime":null,"somePropFromServer":"whats up?","serverTime":"2020-01-13T15:35:27+07:00"},"userAuth":{"lastname":"","isAuthenticated":false,"login":"","time":"","isFetching":false,"isLogging":false,"token":null,"id":"","firstname":""},"routing":{"locationBeforeTransitions":null}}</script>

can you help me for this :)

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.