Giter Site home page Giter Site logo

Difference between nuxtjs? about deprecated HOT 17 CLOSED

ream avatar ream commented on April 27, 2024 6
Difference between nuxtjs?

from deprecated.

Comments (17)

egoist avatar egoist commented on April 27, 2024 18

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.

egoist avatar egoist commented on April 27, 2024 3

@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.

jazoom avatar jazoom commented on April 27, 2024 3

@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.

jazoom avatar jazoom commented on April 27, 2024

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.

jazoom avatar jazoom commented on April 27, 2024

@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.

ansarizafar avatar ansarizafar commented on April 27, 2024

@jazoom Are you using token based authentication and user authorization? If yes could you please share your implementation details with some code.

from deprecated.

jazoom avatar jazoom commented on April 27, 2024

@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.

ansarizafar avatar ansarizafar commented on April 27, 2024

@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.

jazoom avatar jazoom commented on April 27, 2024

@ansarizafar I prefer superagent to axios. Perhaps you can find the answer in the axios docs?

from deprecated.

ansarizafar avatar ansarizafar commented on April 27, 2024

@jazoom Could u please share how you are dealing with Authentication and Authorization with Ream.

from deprecated.

jazoom avatar jazoom commented on April 27, 2024

@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.

ansarizafar avatar ansarizafar commented on April 27, 2024

@jazoom localStorage is not available on server. How you authorize routes on server.

from deprecated.

jazoom avatar jazoom commented on April 27, 2024

@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.

ansarizafar avatar ansarizafar commented on April 27, 2024

@jazoom I am using JWT for authentication from last 3 years.

from deprecated.

dohomi avatar dohomi commented on April 27, 2024

@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.

egoist avatar egoist commented on April 27, 2024

@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 in nuxt.config.js
    • Use a router from $srcDir/router.js

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.

dohomi avatar dohomi commented on April 27, 2024

@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)

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.