Comments (4)
Yeah you're definitely right about that. I've yet to do it successfully so am still searching for the correct way. Maybe I'll spend some quality time with it tomorrow to see how this should be handled, as the server portion of the starter kit needs a lot of TLC.
I'll get back to you if I figure anything out.
from react-redux-starter-kit.
So I decided to sort of usurp your /server
directory for this purpose, which I think is setup for server rendering, but isn't something I am that familiar with nor needed at the moment since its only going to be used locally. I then update the Procfile
to spin up my koa server and the webpack dev environment.
When I used webpack for a heavy client and rails for a backend API I used a setup inspired by this example https://github.com/justin808/react-webpack-rails-tutorial
I figured I'd pass the info along in case it helped.
from react-redux-starter-kit.
@lifehackett I've started work on a branch (https://github.com/davezuko/react-redux-starter-kit/tree/feature/development-server) that will increase the cohesion between webpack-dev-server and Koa. It will probably still be at least a week before I'm able to merge it into master, but here's what's new so far:
- The
npm run dev
task will run both servers side-by-side, rather than just webpack-dev-server. - Koa server is now pre-processed with babel/register, so it can directly use the React app without having to precompile it. This means it can be smarter about rendering routes and can much more easily inject data into the compiled markup.
- Implemented nodemon, so if you change anything in server/client the server will reload as well. Most universal examples I've seen don't do this, which means the server rendering quickly gets out of date.
The biggest hurdle I'm facing due to this integration, however, is that there's no easy way to perform non-js imports. Since the application required in the server is not processed with webpack, you lose out not only on those imports but also on things like path aliases. It's really nice having a more convenient development mode, but I'm not sure if the tradeoffs are worth it.
from react-redux-starter-kit.
Closing this since the server is no more.
from react-redux-starter-kit.
Related Issues (20)
- what is `@import '~bootstrap/scss/bootstrap.scss';` meaning at `src/styles/main.scss` HOT 2
- browserHistory.push change url path but not really loads the component.
- help wanted: Using javascript generator
- Modularizing code (Fractal setup)
- Migration to another project HOT 1
- Seeking New Maintainers HOT 8
- Reuse action creator in other Fractal route container
- verbose stack Error: [email protected] start: `better-npm-run start` HOT 1
- Can I use this kit for react native project?
- bootstrap data-toggle and data-target
- npm run deploy high cpu usage
- Heroku production deployment
- can not import semantic-ui-css/components/button.css
- Implement server side rendering in updated code.
- Implement server side rendering in updated code.
- Unable to create zip with data Node issue
- I am running on AWS Cloud9 HOT 1
- How to save the parameters passed during the routing jump and to apply this parameter when refreshing the page. HOT 1
- Server/main.js Routes
- Safari Unexpected token const
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-redux-starter-kit.