lirantal / Riess.js

Riess.js is a de-coupled full stack JavaScript application framework
16 stars 10 forks source link

Feature: change express.js to class-style #4

Open lirantal opened 7 years ago

lirantal commented 7 years ago

Currently config/lib/express.js is using the old node.js module.exports style. Change it to use ES6 Classes.

rdelhommer commented 7 years ago

Hi @lirantal, I'd like to do this if no one else has claimed it yet. I'd ultimately like to get involved with this project.

I use Mean.JS for a lot of my projects, and it would be awesome to work on the next evolution of it and learn something from the pros at the same time ;)

lirantal commented 7 years ago

Thanks, that sounds great! You're welcome to get at it.

One tip - once you start refactoring stuff it's fairly easy to get pulled into a large refactoring. Since I'm also changing a lot of things behind the scenes try to keep the refactoring focused. I'm also not opinionated yet on final design so if you have ideas to suggest and do better please bring it up :-)

Goodluck!

rdelhommer commented 7 years ago

Sounds good! If I have any ideas, should I just open up a new issue? I have a couple floating around in my head, but they definitely warrant further discussion as I'm not sure if they're good or not 😄

lirantal commented 7 years ago

Yep. Open an issue and let's discuss there and figure out how to handle or open separate issues for each.

FYI:

  1. Look at my new Error handling PR, it has a small change to the Express setup
  2. I'm considering removing the session authentication entirely and go with Social Logins + JWT auth.

None of the above should interrupt you to update the express lib however.

rdelhommer commented 7 years ago

Ok cool! I definitely support a transition to JWT auth as hybrid-mobile frameworks like Cordova have issues with session-based auth

rdelhommer commented 7 years ago

@lirantal Have you guys settled on a pattern for private class members?

For example, in the services/express.js file, the init function seems to be the only member that needs to be public, however I'm having a hard time finding a built in mechanism within ES6 for creating private class members. Does that exist? If not, what do you want to do?

lirantal commented 6 years ago

there's no concept of private properties in JavaScript except for an open proposal of using # notation but that's not relevant.

I wouldn't bother too much with private/public access for now, and maybe the express.js file should actually expose static method(s). haven't yet thought about it much but that would probably be an easy start at it.