A talk about the future of Rails and the future of Rails developers, written for junior developers studying at RMIT.
Mentor / Author / Developer
View Slide
PARTONE
ISN’T RAILSTHE FUTURE OF RAILSAS YOU KNOW IT TODAY
A browserDatabaseBackendAppModelsRails AppIn the past…
A browserJS AppDatabaseFrontendAppBackendAppModelsRails AppNow…
COMMUNICATIONA browserJS AppModelsDatabaseRails App???
A browserJS AppModelsDatabaseRails AppREST + JSON API/api/posts/api/comments…Currently…JSON APIs
GET /api/posts/1{"id": 1,"title": "Hello World","body": "This is my blog's first post.""author": "Ryan Bigg"}JSON APIs
GET /api/posts/1/comments[{text: "Great first post!",by: "Totally not Ryan"},...]JSON APIs
A browserJS AppModelsDatabaseRails AppREST + JSON API/api/posts/api/comments…Currently…JSON APIsNeed to build lots of these…
EVERYONEDOES THIS
EVENFACEBOOK
Well…they did
A browserJS AppModelsDatabaseRails App/graphqlNow…GRAPHQLOnly one endpoint(born 2012)
POST /graphqlquery postQuery {post(id: 1) {idtitlebodyauthorcomments {textby}}}{"data": {"post": {"id": 1,"title": "Hello World","body": "First post!”,"author": "Ryan Bigg","comments": [{text: "Great first post!",by: "Totally not Ryan"},...]}}}Query ResponseGRAPHQL
POST /graphqlquery postQuery {post(id: 1) {idtitlebodyauthorcomments {textby}}}{"data": {"post": {"id": 1,"title": "Hello World","author": "Ryan Bigg","comments": [{text: "Great first post!",by: "Totally not Ryan"},...]}}}Query ResponseGRAPHQL
POST /graphqlquery commentQuery {comment(id: 1) {textuser}}{"data": {“comment”: {text: "Great first post!",user: "Totally not Ryan”}}}Query ResponseGRAPHQL
GRAPHQLIS THE FUTURE
GRAPHQLIS THE FUTURE(or at least, it seems like it)
THE FUTURE OF RAILSFrontend + Backend appstalking overGraphQL
ENDPARTONE
PARTTWO
RAILSIS ALWAYS CHANGING
Then… Now…
THE NEWSHINYIS ALWAYS CHANGING
JSON GRAPHQLAPIs APIs
RAILSIS JUST A TOOL
APIsARE A CONCEPT
THERE AREINFINITYTHINGS TO LEARN
FOCUS ONCONCEPTS NOTTOOLS
{ name: “Ryan”, age: 30 }%{ name: “Ryan”, age: 30 }RubyElixir
h = { name: “Ryan” }if h.has_key?(:name)puts “Name: #{h[:name]}”elseputs “name is not present”endRubyElixirfn%{name: name} -> IO.puts(“name: #{name}”)_ -> IO.puts(“name is not present”)end
CONCEPTS SPANTOOLS
What is a funcFon?
How dopages load?
/graphql isreturning an HTTP500 status codeWhy?
The appstoppedresponding.
CPU usage is high.Can you find out why?
What is“clean code”?
Is this“clean code”?
What do otherdevelopers consider“best pracFce”?
Follow the code.
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………Test the code.
ENDPARTTWO
✉: [email protected]Thanks!: @ryanbigg▶: h?p://bit.ly/radar-for
h?ps://developer.github.com/v3/API ExamplesREST + JSONh?ps://developer.github.com/v4/GRAPHQL
h?ps://www.howtographql.com/Learn these:GraphQLh?ps://reactjs.org/tutorial/tutorial.htmlReact
h?ps://www.sandimetz.com/99bo?les/Read these:99 BOTTLESh?ps://www.poodr.comPRACTICAL OBJECT-ORIENTED DESIGN IN RUBY
h?ps://joyofelixir.comLearn Elixir from scratch!
h?ps://speakerdeck.com/radar/exploding-railsh?ps://leanpub.com/exploding-railsExploding Railsh?ps://github.com/radar/twist-v2MY EXAMPLE APPLICATION