michaelbenin / react-ssr-spa Goto Github PK
View Code? Open in Web Editor NEWServer side rendered single page app using reactjs official libraries.
License: MIT License
Server side rendered single page app using reactjs official libraries.
License: MIT License
Currently <!doctype> needs to be
Fix:
change to:
.pipe(livereload({ file: '/css/main.css' }));
;
Right now it's at 51% for server and 13% for client.
if (/PAGE_LOADING/.test(action.type) && canUseDOM) {
return extend({}, state, {
code: 200
});
}
Waiting on: Unitech/pm2#2995
Fixed here: gotwarlost/istanbul#816
example http://url#something causes invariant error when parsing
This is known, everything is working as expected.
Thread here: facebook/react#812
In initializer for server use this snippet:
if (process.env.NODE_ENV === 'production') {
require('react/dist/react.min.js');
require.cache[require.resolve('react')] = require.cache[require.resolve('react/dist/react.min.js')];
require('react-dom/dist/react-dom-server.min.js');
require.cache[require.resolve('react-dom/server')] = require.cache[require.resolve('react-dom/dist/react-dom-server.min.js')];
}
Should have an example.
From the comment from UXLayout here: remix-run/react-router#3936 doesn't look like there's a "happy path" for this yet.
Waiting on foundation/foundation-sites#9458 to upgrade.
Errors in render method will cause server to hang. The issue is known:
facebook/react#2461
Also enable chrome headless: https://swizec.com/blog/how-to-run-javascript-tests-in-chrome-on-travis/swizec/6647
Webpack 3 etc - quarterly chore
Try adding babel-register to mocha opts in config.
https://gist.github.com/gaearon/9a4d54653ae9c50af6c54b4e0e56b583#javascript-environment-requirements
Also add a check for support in legacy browsers, if not load in the polyill
See example here: https://github.com/bemusic/bemuse/blob/master/karma.conf.js
// https://github.com/visionmedia/supertest/pull/297#issuecomment-275826472
function createVhostTester(app, vhost) {
const real = supertest(app);
const proxy = {};
Object.keys(real).forEach(methodName => {
proxy[methodName] = function() {
return real[methodName]
.apply(real, arguments)
.set('host', vhost);
}
});
return proxy;
}
var api = createVhostTester(appInstance, 'api.example.com');
var appTest = createVhostTester(appInstance, 'app.example.com');
Issue: webpack/webpack#2145
Bootstrapped config randomized properties.
Close the stream on error:
import gulp from 'gulp';
import { log } from 'gulp-util';
import changed from 'gulp-changed';
import babel from 'gulp-babel';
import config from './../configs/config';
gulp.task('babel-server', function babelServer() {
const babelStream = babel({
sourceMaps: 'inline',
presets: [
'react',
[
'env',
{
targets: {
node: 'current'
}
}
]
]
});
babelStream.on('error', function handleError(err) {
log(`Error transpiling babel in gulp_babel_server task.`);
log(err);
babelStream.end();
});
return gulp
.src(config.server.src)
.pipe(changed(config.dest))
.pipe(babelStream)
.pipe(gulp.dest(config.dest));
});
Source: gulpjs/gulp#71
Provide how we contribute to the project.
In server rendering, it's important to use utf-8 in browser for the bootstrapping of data.
After initial page load client can return null. Only needed to bootstrap data.
We pass store around a lot, it makes more sense to use dispatch and state, also we plan on moving the data fetching to be called on the component from the client instead of in the browserHistory listener.
Sometimes we have components which only work in the client and we don't want to render them on the server. What we can do here is check for the initial page load in the state, if it is don't render the component until after that render. Essentially, render first without client side component by doing a check if it's initial page load, after that, an event is dispatched, the component then rerenders with the client side component. This solves issues with invariants with components from react-d3 and many others.
reactjs/react-router-redux#481
Revert to previous release.
https://github.com/indutny/webpack-common-shake
I also think it would be cool to have a code splitting branch. I try to avoid it until I actually need it.
@johnferrie's base seo util would be great to have, maybe scaled back to be more generic to allow people to extend for their needs.
Issue here: remy/nodemon#1003
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.