Giter VIP home page Giter VIP logo

cra-ssr-code-splitting's People

Contributors

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cra-ssr-code-splitting's Issues

Any possibility to extend it to production use?

It would be nice to get a section on what to consider for production use. The idea is pretty simple: having a proxy between REST API -> SSR server -> ReactJS client. I think, lots of people are looking for this, so would be highly appreciated.

about SSR

not sure if this is called "SSR", because neither "Hi, I'm async." or "Redux: Hi, I'm from client!" are not rendered at server side. By looking at the page source (which is what a bot get normally), there is no SEO value at all. Is this because I opened it in a wrong way?
Thanks.

Babel 7

Great repo, would be really good to update the babel requirements for Babel 7 (things like @babel/register instead of babel-register etc.

Question: application ssr with livereload?

Hi!

I am trying to add SSR to CRA and i have seen (also from your repo) that is possible only with the build folder. So there is no way to have SSR with livereload if you don't create a custom webpack file for it.

What do you think?

Undetected chunks

Hello, thank you for this example and for the article that you shared on Medium.

I am experiencing a weird behavior that is really driving me crazy crazy crazy. I wonder if you stumbled upon something similar yourself.

if you change the PageAnother.jsx to:

import React from 'react';
import moment from 'moment';

export default () => (
    <div>This is for another page. {JSON.stringify(moment())}</div>
);

(basically adding a dependency)

the SSR will break.

Actually, the SSR itself works just fine, but it fails to detect all the chunks that the app generates and uses. This end up in a re-rendering in the client.

If you look at the requested js files with the Chrome console, and compare it with the list of chuncks that are present in the html source, you'll notice that chunk 5.xxxxx.js is missing in the original HTML source.

This is what is causing the flickering.

Do you have any idea how to fix this?

Question ?

Can this code be used as a boilerplate for building frontend react applications ?

Image import is not resolved yet

Hi Andrie, I just read your post on medium recently about the SSR and Create-React-App without ejecting. It's awesome!

However, the following line of code confuses me:

<img src="./logo.svg" className="App-logo" alt="logo"/>

I think for the client-side-rendered react app, the image assets are imported and resolved by webpack loader:

import logo from './logo.svg';
// ...somewhere in the render method
<img src={logo} className="App-logo" alt="logo"/>

Accordingly, the original way does not fit your medium post. How would you resolve that kind of problem without adding extra webpack config on server-side or ejecting create-react-app?

Thanks a lot.

How to support dynamic meta tags which are asynchronously resolved

So far I managed to adapt this boilerplate code for my project. Now I need to support dynamic meta tags for some routes. These components receive the meta tags using an API call to the server. Actually meta tags are set and viewable via inspecting the browser. But Facebook sharing debugger only reads the static meta tags.

<Helmet>
         <title>{this.state.firstName+' '+this.state.lastName}</title>
         <meta name="og:description" content={this.state.description+" this is my profile"} />
         <meta property="og:image" content={"/images/share/home page share.jpeg"}
</Helmet>

state values are set by an API call inside the component. In the above example og:image is set as it is static. og:description only has static portion after scraped by facebook sharing debugger. Am I missing some step? data to be set meta tags are loaded in compnentWillMount life cycle.

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.