Comments (17)
To close this issue I'd like to make a conclusion as follows:
tl;dr
You got more control over your app code.
The same:
These two (Ream and Nuxt.js) both abstract away a lot of the boilerplate code, and provide some extra features such as static site generation
The differences:
What Nuxt.js/Next.js do:
Nuxt.js, like Next.js, which makes a convention that you should use ./pages/*.vue
structure to organize your route components, but why?
- for Next.js, to code-split routes, they treat every route component as a webpack entry and inline the bundle into rendered page directly
- for Nuxt.js, they achieve code-split by using dynamically import, but it does not support dynamic statements like
import('./pages/' + route)
, it has to be a specific string, so the solution is generating a router based on./pages
file tree, this is the template of the router.
What Ream does:
If we don't need the ./pages/*.vue
structure, it would be much easier to code-split routes, use dynamically import in your router and you're good to go.
Nothing is really special, the goal of this project is to reduce hidden magic (comparing to Nuxt.js) and build configs of course.
This is started as a fork of vue-hackernews-2.0, basically I want to make it reusable as a module or CLI, and the motivation is simple, a fixed folder structure feels a bit annoying when I was building a tool based on Nuxt.js API
This might be how the abstraction level looks like:
Nuxt.js > Ream > Boilerplate
You have more control over how router is created, how route components are organized...
from deprecated.
@jazoom I still maintain vbuild but that would only focus on front-end apps to not to bloat it up, and Vue SSR is not yet stable (it works though)
from deprecated.
@egoist Just thought I'd pop back and say that you've done a fantastic job with this project. I didn't have too much trouble moving over a complex app with a custom WebPack setup. Everything seems to work as intended. It's magical, in a good way.
It's obvious you put a lot of thought into designing how everything fits together to make a minimal API surface area.
Keep up the great work!
from deprecated.
NuxtJS is more opinionated in how you should structure your app.
I'm more confused about why the developer decided to stop developing vbuild and start on this. This seems superior (SSR) but I'm not sure why it wasn't just added to vbuild.
from deprecated.
@egoist Well this seems like a great project. I'm just testing it out now.
The docs are a little confusing in that they're missing pieces of information required to follow them, which might be difficult for people who aren't very familiar with how Vue works. That's unfortunate since they are the people who would really benefit from Ream. I know it's early days, though.
Anyway, I hope you keep working on this because NuxtJS doesn't work well for some apps. Ream seems much more flexible.
from deprecated.
@jazoom Are you using token based authentication and user authorization? If yes could you please share your implementation details with some code.
from deprecated.
@ansarizafar I'm not quite sure what you're asking. There are many ways to handle user auth. It really doesn't have anything to do with this library.
from deprecated.
@jazoom
I am trying to use express-jwt and express session to store token in a cookie. How can I set axios header, authorize routes and access token in vue components. Nuxt uses middle ware to set axios header like this
import axios from 'axios'
export default function({isServer, req}) {
if (isServer) {
axios.defaults.headers.common.cookie = req.headers.cookie
}
}
and then store token in store
nuxtServerInit ({ commit }, { req }) {
if (req.session && req.session.authUser) {
commit('SET_USER', req.session.authUser)
}
}
Could you please suggest How It can be done with Ream.
from deprecated.
@ansarizafar I prefer superagent to axios. Perhaps you can find the answer in the axios docs?
from deprecated.
@jazoom Could u please share how you are dealing with Authentication and Authorization with Ream.
from deprecated.
@ansarizafar Like I said, it has absolutely nothing to do with Ream. I didn't change any of my auth code when migrating from my own solution to Ream. I don't even use cookies for auth. I use JWTs and localStorage. You can find many tutorials about that online, just as you can probably find many tutorials for server session-based cookie auth.
from deprecated.
@jazoom localStorage is not available on server. How you authorize routes on server.
from deprecated.
@ansarizafar If you go read a tutorial on JWTs you'll know. This is a basic concept so you have quite a lot of learning to do. I don't think going through each step in a Ream issue thread is appropriate.
from deprecated.
@jazoom I am using JWT for authentication from last 3 years.
from deprecated.
@egoist a lot of things changed in nuxtjs like the ability to use own page structure and using an own router.js file.
Isn't the gap between nuxtjs and ream very small already? I've seen you committed into the nuxt project as well, where do you see the main differences at the moment?
from deprecated.
@dohomi yeah the gap is really small now.
For the difference on folder/app structure:
- In Ream you can control almost everything in your entry file
- how to create router
- how to create vuex store
- set options for vue root instance
- use your own root component
- how to add CSS/fonts
- etc..
- In Nuxt
- Use
pages
structure, configure other stuffs innuxt.config.js
- Use a router from
$srcDir/router.js
- Use
What else Ream doesn't have:
- A robust API for building complete applications, e.g.
validate
middlewares
layout
etc. Nuxt.js is actually like Ruby on Rails for Vue.js 😄. You have to implement all these stuffs on your own in Ream, that's a bit inconvenient comparing to Nuxt.js - Good documentation
What else Nuxt.js doesn't have:
- A better way to modify webpack config, a.k.a. using something like
webpack-chain
, but this is not hard to implement in the Nuxt.js land - A low-level API to control SSR, you can write your own
renderer
in Ream. Well this is out of the scope of Nuxt.js.
from deprecated.
@egoist thanks for your explanation. I started with nuxt beginning of the year but came across your package 6 months ago and have seen that you started with a v2 branch. Will see if I find an upcoming project to play with ream for a bit
from deprecated.
Related Issues (20)
- Default error message (You must create pages/*.vue) is misleading
- How to use i18n in my project HOT 5
- Critical: Ream creates invalid Webpack config object HOT 4
- getInitialData is lost when using Vue.extend HOT 4
- Client-side getInitialData redirect to absolute URL shows new component for a moment HOT 1
- Unexpected token initialDataKey HOT 3
- Client-side getInitialData redirect to relative URL doesn't work HOT 1
- with-apollo example is outdated HOT 1
- `ream dev` triple rebuild HOT 3
- Change enhanceApp context API HOT 4
- Vuex example not listing vuex in package.json HOT 5
- how to use postcss
- Disable SSR for some part of code HOT 1
- Ream fails to compile with newest Webpack due to missing uglifyjs HOT 2
- Exception in getInitialDate returns HTTP 200 HOT 1
- Prefetching data with `ssrPrefetch`
- is there any guide for deploy and build? HOT 3
- how to enable babel-polyfill in webpack?
- how to use mqtt in ream for browser?
- In latest webpack, cache is mistakenly reused between server and client builds HOT 3
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 deprecated.