chadfurman / rpg-boilerplate

Relay (React), Postgres, and Graphile (GraphQL): A Modern Frontend and API Boilerplate
61 stars 5 forks source link

In need of updates #26

Open brandonkal opened 5 years ago

brandonkal commented 5 years ago

Things are out of date and are causing problems:

warning "graphile-build@0.1.0-alpha.32" has incorrect peer dependency "graphql@>=0.9 <1".
warning "graphile-build-pg@0.1.0-alpha.32" has incorrect peer dependency "pg@>=6 <7".
warning "graphql-parse-resolve-info@0.1.0-alpha.18" has incorrect peer dependency "graphql@>=0.9 <1".
warning "graphql-iso-date@3.3.0" has incorrect peer dependency "graphql@^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0".
warning "graphql-type-json@0.1.4" has incorrect peer dependency "graphql@>=0.4.0".
brandonkal commented 5 years ago

Furthermore, running docker/run.sh shoots CPU usage up to 60%+ on my i7. For a simple server, this is too much so something is broken.

I like the idea of this project but as it is now, I'll just be looking for inspiration in the db folder.

benjie commented 5 years ago

If you’re interested in helping, separate small pull requests for each issue will be easier to review than one big one.

Upgrading PostgreSQL from 9.6 to 11 would result in faster queries and a few more features but 9.6 is still supported until 2021; interested to know what issues you feel it is causing?

Similar question for Node.

I wouldn’t worry too much about the “incorrect peer dependency” issues, a yarn upgrade --latest --interactive may help resolve them, but likely a good few will remain. They tend to be harmless/overly sensitive.

Not sure why docker/run.sh is so intensive on your machine; please could you open a new issue for that with additional details such as your OS, a more precise and descriptive summary of the symptoms you’re experiencing, and anything else you think may be pertinent.

chadfurman commented 5 years ago

@brandonkai and @benjie I'm currently working on a more robust version of this template. It will still contain Relay and Postgraphile (Postgres and GraphQL) along with a revamp'd docker-compose setup, better support for SSR and routing through NextJS, and most relevantly to this discussion a full set of updates. If you're interested in assisting with this process, the current code is here: git@github.com:clevertech/boilerplate.git

Please note I'm focused on the frontend at the moment, and as such I have not made it to the API folder (where the obvious Postgraphile relevance will be). In fact, I've not yet ported in Relay Modern either. Currently, I'm working on laying the groundwork for the UI with https://reakit.io -- this is going to be minimal and lightly styled with support for:

  1. Login
  2. Signup
  3. Password Reset
  4. PassportJS

With all four of the above fully connected via routing, rendering, API calls, database migrations, and unit tests, I will consider rpg-next fully featured

brandonkal commented 5 years ago

@chadfurman Thanks for this update! I am currently building a UI library and reakit looks like a great reference.

If you are going to port Relay, would you consider an alternative library to Relay rather than porting to Modern? I would prefer Gatsby over NextJS since it already handles all of the SSR and is a great DX, but as far as I am aware, Relay conflicts with Gatsby because its template tag is also used during build time. Even if you went with NextJS though, it would make moving between the two easier.

benjie commented 5 years ago

Next does SSR?

benjie commented 5 years ago

@chadfurman this is really cool; I've sent you some chat messages with some insider info, and am totally up for collaborating on this 😁

chadfurman commented 5 years ago

Are we all talking about the same thing, here? https://nextjs.org/#features Next's whole dealio is SSR -- that's why they have their own sass package, page system, etc.

I looked at Gatsby but it is even more opinionated than Next. I'm going to be making some video documentation at the end to help beginning devs customize the project -- including how to swap out reakit and bulma for material UI, how to add 2FA with Passport, and more. I could potentially add (or you could add) a video for switching from Next to Gatsby, or even removing Next completely (it would need a new routing layer and would likely lose SSR, and maybe also lose code splitting and AMP support).

I'm using Relay modern in RPG-boilerplate, currently, and plan to continue using Relay Modern in RPG-next. The main difference is RPG next will use Relay 4

brandonkal commented 5 years ago

Yes. What I mean is that the key difference here is that Next does on demand SSR whereas Gatsby renders the HTML pages during build. This means next requires three code bases (client, server, graphQL API server) where Gatsby requires just two (client, graphQL API server) and there is less server load. It works great for the app shell pattern. So like anything, it depends on what you are building. A Next vs Gatsby implementation video would be interesting so I do support you using NextJS here.

benjie commented 5 years ago

Interesting point; there is a downside though - Gatsby's SSR only SSRs static/public data whereas Next can SSR data from the logged in user. But I totally hear your point about reduced server load/code, and logged in users need SSR less (it's just a nice to have reduced latency on initial page load, or for users with JS disabled/etc) whereas public needs it for search engines/etc.

chadfurman commented 5 years ago

I'm grateful you accept Next as a path for this project; do you know Next also supports static site generation? I.E. no need for an SSR server? https://nextjs.org/docs#static-html-export

chadfurman commented 5 years ago

regardless, I am grateful you are interested in this project and I am more motivated to push code and provide updates as I go now that you have expressed yourself in this thread.

Both of you :)

Thank you.

brandonkal commented 5 years ago

@chadfurman I was not aware of Next's static HTML export feature. Awesome stuff!