Golang UK Conference 2017 | Mark Bates - Buffalo: Rapid Web Development in Go

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I think the community's advice is a little more nuanced than what was presented in the talk (and I'm sure the presenter understands this). I would summarize the general advice as follows:

  • If you are authoring a library, try to stick to only the standard lib as much as possible so that users of your library don't have to pull in extra dependencies.
  • If you are writing an application, start with the standard library so that you understand what it's capabilities are instead of assuming you need a third-party library. Most libraries try to maintain compatibility with the standard lib anyway, so switching to something more feature rich later isn't usually an issue.
  • Frameworks in general are discouraged as they tend to go for a kitchen sink approach. Just like Go itself and its use of small, well-defined interfaces, the community encourages the use of small libraries that play nicely together. This approach gives the developer more choice and flexibility.

Gathering together a list of vetted libraries that work well together and providing them to users in a way that is easy to learn should help ease the pain for those coming from languages with a popular web framework. But I do think there is value in the sometimes unexplained reasons why people just say "use the standard library".

πŸ‘οΈŽ︎ 11 πŸ‘€οΈŽ︎ u/frebb πŸ“…οΈŽ︎ Sep 22 2017 πŸ—«︎ replies

This guy is trying to "sell" his web framework. What do you expect him to say?

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/shovelpost πŸ“…οΈŽ︎ Sep 21 2017 πŸ—«︎ replies

I tried Buffalo out the other day. The boilerplate application it created immediately died in flames due to some error in all of the Node crap it installs.

I guess a full-featured library is nice enough in theory, but the Buffalo docs don't do a very good job of explaining how all the parts fit together.

So I deleted the lot and now I'm going to just use the standard library instead. With a bit of Gorilla, natch.

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/__crackers__ πŸ“…οΈŽ︎ Sep 23 2017 πŸ—«︎ replies

When I saw the generated boilerplate it was pretty clear this is totally different from what the rest of the community treats programming like. I guess this is the webdev take on Go? At no point was it clear to me why this was done in Go but not PHP or whatever established webdev language.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/SSoreil πŸ“…οΈŽ︎ Sep 21 2017 πŸ—«︎ replies
Captions
thank you all right yeah I'm glad to see so many of you here from the Tiki party last night I almost didn't make it as well sad but true so yeah my name is Marc Bates where you're here to talk about rapid web development with go I won't be nearly as funny as Matt and at look at their leaving already oh I can completely understand if anybody else didn't know this was me you can absolutely leave my god and I was just about to compliment you these are my friends according to my mother's paychecks so those of you who saw and saw their talk just a few minutes ago know that this is actually how I look in real life but this is how I look as a gofer that is my custom Ashley McNamara gopher down there in the corner what I love what this is nobody else has this gopher it is impossible that guitar is unique to me the hair the shirt everything else you got to go for eyes me that's mine so Who am I for those of you who don't know which I assume is almost everybody except for the people in the front row here and you I said my name is Marc Bates you can find me on the Twitter's the github slack as Marc Bates I run a company called gopher guides which does customizable training so if you have training needs come find us I also run go Buffalo do which is what we're gonna talk about today we're gonna talk about the wat in the why and the what I say and the Buffalo oh and demo but what do I in the demo this is an interesting project and I think this project has we can have a real impact on the NGO community a really positive impact I think and I'm not just blowing smoke because I'm amazing and actually made this beautiful logo here I should talked about so let's talk about web development ago and why I think Buffalo is what we need to not only be able to do better make faster websites or make websites faster but also to grow the community to make the community stronger and better who has heard this phrase before right literally everybody I see this on Reddit and Twitter and slack like I'm looking to build a web app what do i do just use a standard library which is I think just awful advice that's the equivalent of saying RTFM all right just go use the standard library how do you not know this but I've never written go before but it's in the standard library and by the way the standard library is amazing and one of the best standard libraries we have I've ever seen so I'm not downplaying the standard library but talking about the the way that new people come to go and what they see and what their first reactions to the go community are and unfortunately a lot of people's first reactions it's is this very elitist kind of we're better than you we don't need your stinking frameworks we don't need your rails your symphony your Django or whatever right we roll our own who's heard that phrase before just roll your uh that's fun because I want to ship an app this weekend I'll just roll my own rails that's gotta be easy the standard library is essentially a collection of building blocks that's really what's been for I think Steve said the other day it's meant for library authors not really for end-users right like it's meant for the people in this room to build really cool packages so that those new people coming in could do something even simpler and even more amazing this by the way is the world's largest Lego sculpture ever made it is a life-size life-size as if they really exist x-wing fighter if it's in California and if you ever see the movie brick you're the brick you mentoree on Lego who's seen that nobody oh my god it's amazing they talked about the building of this thing and how they shipped it and manufactured it and construction it's awesome and this is me and my oldest son a few years ago he was very excited not as excited as me but he was kind of excited I really had to pay him to do that so look every language getting back to standard library language has a standard library some are better than others and go is definitely one of the best but why would you want to build a web app using justice standard library let's take Ruby for example right ruby has a staring library ruby has web app stuff in the standard library does anybody here every built a web app using just the Ruby standard library I didn't think so has anybody here built a web app using just the Java standard library the dotnet standard library no see you kind of see where I'm going with this we are like the only language who touts this way of building complex web applications just use the standard library it's great it really is but why would you want to do that why would you want to sit there and spend all that time rolling your own there are reasons I'm not gonna say there aren't reasons there are plenty of reasons to just use a standard library you know Matt talked earlier about building gopher eyes me in five hours it's got how many endpoints to two or three yeah right it's a tiny little app right you don't need yeah you don't need a rails to build gopher Γ«ismΓ­ but you know what you do need something like that for its to build a giant web application a business you can't roll your own and get that to market anytime soon and for me it's all about getting to market I need to get to market you need to get to market because that's how our businesses are built web apps are not simple don't let anybody tell you they are here are a few things that almost every web application needs and I'm not talking ago fries me that to end point thing I'm talking you know you're gonna build the next big thing hopefully right you're gonna build a business you need all of these things and they don't all exist in the standard library they're not there some of these things are but not all of them so now I want you to imagine just for a second you knew who is new to go oh wow okay fantastic so you don't have to imagine the rest of you pretend you're them and do a little mental exercise you're new to go and you say I this new startup idea and I'm gonna crank it out this weekend because that's what I'm used to doing in some other languages I can roll a django app and weekend or rails the symphony app what have you so I'm gonna roll it and go because I hear go is the next big thing I'm gonna create a ride chair because as we found out yesterday from Steve you cannot create a ride-sharing app that without using go so that's we're gonna do so I say okay I know I got to do all these things so let me start looking through the standard library right okay well router I found those to serve mocks fantastic so I got a little hello world going where we're rocking now I want to do a post requests can't really do that I can put a case statement in there that that seems good or an if I'll start with an if maybe and then very quickly you're like I need a third-party router I'm gonna have to pull in gorilla mocks or HTTP router and now I'm on reddit saying does anybody know of a good road or I can use the serve MUX doesn't do it for me and they respond with just use the standard library and then somebody yells the other person flips their finger off but it becomes a whole international incident yeah so anyways oh my god okay fine okay I'll use it I'll use gorilla mocks I'm in third priority now I'm gonna get to templating and you start using the attempting library and you're like oh I really need to do a slightly complex if statement in my liya I can't do that I can't I what if I want to pass a function into another function like a nice little help oh I can't do that does anybody know of a good template package and all of a sudden like you start going down this list and you realize like the standard library is good but it is not gonna get you this app out in a weekend and I have talked to a lot of brand-new developers and those of you new to go who's tried to write a web app using standard library something fairly complex yeah tell me if any of these words sound familiar to you scary daunting unwelcoming that's the problem we're having you don't see that Steve Steve's going maybe Ashley says yes unwelcoming this is how I fell I felt like that when I first came well I know put the peanut gallery in the front rounds I did I didn't know I did not invite you I specifically said you should goes to the other top watch mine on video later the problem I've found is I've talked about people this is the way they felt and then they're gone they don't come back they pull of Kaiser so say hey just if you don't understand that reference you are missing a an amazing movie absolutely amazing movie and I've just ruined the ending don't point your watch again now but if you ever see it try to forget this so I had a lot of people I've been doing go now for for almost five years now and during that time I've shown up at a lot of usually a lot of Ruby me that's telling everybody use go which by the way is really mean don't do that like don't go to other people's meetups and tell them that they're doing it wrong I do that that's my job if you start doing that I'm out of business that's their good but I'd show up and these people would say okay mark you love go what do you used to build web apps I said well you just use rails and I'm like well that seems counterintuitive to your statement of go is amazing and it is but this was me honestly up until this year and then this happened Buffalo the the question is where's the logo came first or not it did now so yeah well let's talk about Buffalo buffalo is an ecosystem for rapid web development is it a framework you might say that I won't because the framework is where it is taboo in our industry for some reason or at least this community the word framework is like a kiss of death for some reason I was talking to Steve again about this is and I did Steve wrote Cobra who uses Cobra right it's excellent it's excellent but you know what it is it's a framework and Steve said that when he first published Cobra was like why would you need this framework just to use the standard library we have the flags package it's like well have you ever tried to build complicated CLI tool using just a standard library kind of hard not gonna lie to you so Buffalo I like to considered an ecosystem cuz it's not just about the Buffalo package matter of fact the Buffalo package itself is not overly big and that's important to remember what it is is glue around the best parts of go and the best parts of what the community has had to offer for go we take the stance of we'd rather not have to write it ourselves we want to use the gorilla Lux rudder that is battle tested and everybody loves right I don't want to ride a router you don't want me to write a router I can't even say write a router well I said at that time maybe I can build a router who knows um Buffalo takes all this stuff and just kind of gives it to you we found the best packages and I'll talk about some of them in a minute to do all these things for you so that you can roll an app out in a weekend and those people coming to go for the first time can have that positive experience that welcoming experience that they had the first time they went through rails for example I remember going from Java to rails back in 2005 actually fun fact I quit Java in 2003 I quit development I rage quit development after writing a hundred thousand lines of XML and it's not a joke 100,000 lines of XML I rage quit and worked in a recording studio for two years that was and then I was out and then someone introduced me to rails and it was magical it was like oh look how welcoming this is like I can get something out fast and that's what I want I want to just start coding I don't want to spend time figuring out all these pieces right as a consultant as a business owner as a human being I need to just get to market I just want to get my stuff out there I don't want to spend weeks rolling my own custom router or my own templating system or figuring out my how to run migrations against my database I want somebody to figure that all out for me somehow I became that person which is kind of terrible this is an important slide and one I really want to drive home when we talk about Buffalo buffalo is extracted it is not imagined and that is important whenever you're talking to anybody about their new framework their new library their new tool if they imagine if they sat down one day and said you know it would be nice a package a library or framework to do X Y & Z don't use it because it hasn't been used it hasn't been tested someone yes who was it was it Matt was it you yesterday who said like um just hold on to it like don't release anything publicly like play with it learn it right and then you can release it publicly and that's what happened with Buffalo buffalo is years old in a lot of ways and I spent a year working for a company building an enterprise application for them that needed to be installed on-site they needed they didn't know what the database was gonna be so they needed support from MySQL PostgreSQL light they need to feel a ship a binary no other files no templating files no JavaScript files a single binary they need to be able to send it to them and say here here a couple commands and that binary run them and that's where buffalo really took shape and then in December of last year I was talking with Brian Kedleston and I can't remember how the conversation came up I said I'll let me show you something and I showed him Buffalo he's like oh my god you absolutely have to open-source that you need to publish that and then he scheduled me on go time like for two weeks later he could get two weeks yeah two weeks to bang this thing into shape and that's true and his that up did anybody has anybody heard my go time episode couple people yeah you you more of you should because it is the highest-rated go time episode it is and it's live from a Dunkin Donuts which which has a story to it but anyway buffalo has two goals and the first one is incredibly selfish I'm not gonna lie to you it's let me write applications as fast as I can I rails that is a hundred percent the first goal I consider myself to be the primary user of Buffalo actually I consider Brian cattle son to be the primary user Buffalo is rather you push more production Buffalo helps and I have you write one a week I think at this point yeah but for me that was the original impetus right I wanna be able to write apps as fast like Hannah rails the other ones bit more altruistic I want to make go more accessible and I think the web is the best place to do that and why do I think that I think well I know there are more web developers in the world than anybody else well not anybody else there's a lot of Chinese people probably more of them than been web developers I'm almost positive that I'll check later but now there are more web developers than any other type of developers this probably a better qualification and that's a big world we've got between 500 and $100,000 and the other day on Twitter said I was just about to give up on golang and then I found Buffalo and it's almost like a conspiracy to make rails or as Gophers I was like no it's a conspiracy if that's absolutely the point we want to get more people and go because I want a bigger community I want conferences like this to thrive and we're seeing this we're seeing more and more conferences every single year which is awesome but we can make this thing go through the roof and what do we get with a bigger community apart from more information and more diversity and better libraries of better packages we get more jobs who here writes go full-time for their current job not enough people right not enough people and you know why because we need more go developers if you have more go developers companies will take more of a risk on go and it's not really risk as we know go is amazing you're not here to be sold on go you're already paid your ticket or you stumbled in off the street Ernesto but yeah companies will be take more of a chance and they'll say ok look look at all these developers out there and they're all doing these amazing things we should start doing that in-house so more jobs bigger community means more jobs means less not writing go and that's awesome I am down to one rails app one ruby app I have to maintain unfortunately no I'd love to I love the app but I want to write it in Buffalo but it's three years old I can't but I'm down to that and that's an awesome feeling to not have to deal with Ruby anymore nothing against Ruby but I really love go so really what better way to grow go I think then through the web so with that said enough evangelizing why I think Buffalo is important to the community hopefully you feel the same way hopefully you you can see that as a community we can take this project and it's not my project we've got a lot of great contributors and I want to see more contributors but we can take this thing and we can make it big and we can grow this community in a way that's you know we've only just kind of touched the surface on so that's the why of Buffalo if you will let's talk about the what it's probably what some of you were here to see but what a buffalo Buffalo is a batteries included framework and we've heard this phrase before but when I say batteries included I actually mean all of the batteries not just the go batteries and that's an important part of what Buffalo does here are some of the included batteries for example gorilla mocks for routing plush for templating pop for database web pack and yarn for our asset pipeline deployment we've got things like docker and Buffalo build which we'll talk about testing we got go we got some testify in their task scripting if you ever used like a rake in Ruby before we got an amazing system called grift which lets you use the phrase I grana grift today no ok so I named things based on puns never mind okay internationalization sessions the whole nine yards if you don't like the included batteries that's fine just use your own there's only one included battery that is absolutely required that's the gorilla mocks router but if you get down so that's the only one you absolutely have to use but if you don't like your own use the other one you get rid of them a lot of these have flags so just turn them off you don't want webpack turn it off you don't want docker turn it off you don't want plush or templating and use the API flag and boom you're just dealing with JSON stuff right there's lots of lots of customization here we are not forcing you to use anything except for gorilla mocks but with that said understand that if you change that some of these pieces some of the built-in generators may not work for you as I kind of have expectations of what you're expecting to do but for example and I don't expect you to read this code you can replace the templating engine by implementing the template engine type just one function takes three arguments you can create your own renderers it's one func it's a interface with two functions very simple functions and so on and so forth let's talk about development what's the development time like for me buffalo is all about developer productivity that is the number one metric I base buffalo on how easy can I build my app how fast can I build my app I go into an argument with somebody on github the other day because they wanted benchmarks on like the router and stuff with my kid so the gorilla mocks Rodrigo look at their benchmarks and you're like but we've what are you two hiding on top of like does it matter you get two millisecond response times it doesn't matter it's fast enough for you for me the development speed is the benchmark that matters and we'll do this I'm actually gonna build an app and we'll deploy it to Heroku by the end of this talk here we offer a ton of commands buffalo is not just a package it is a tool chain and that's why I say it's an ecosystem the buffalo binary has so many sub commands and so many sub commands off those sub commands so do insane things now we have plugins where you can write your own sub commands for Buffalo and plug them in and we'll see that with my Heroku one later but the Buffalo dev command compiles starts the application for you watches any assets and rebuilds them if you're using webpack so as you change your style sheets and JavaScript and by the way its default configuration is es6 and s CSS and jQuery and all that stuff is kind of ready out of the box we do production minification ugly fiying and stuff like that for you static assets to serve from disks there's no recompiling of go file like you know if you're using like bin data before we have to keep compiling every time we make a change to something we don't have to do that they're all served from disk so later if you're go files change we watch them we recompile the application and restart it for you so the by the time you hit save and vim and you tab back over to your browser your apps already restarted you can refresh the page and area changes we even show you a web page if there was an error compiled in your binary and tell you what the error is we go out of our way to make the developer experience amazing for you deployments this is another key thing we want to be able to deploy our apps quickly and fast one of my favorite ways is docker and if you generate a new Buffalo app for example you get a file that looks like this it's a multi-stage docker file and that's all you need to compile and deploy your application or you can use the buffalo build command which is kind of cool too again builds assets for production if you're using webpack bundles your templates your assets your migrations anything else any other static content you might have into the binary all there in one command auto versions the binary installs the SHA and the build time into the binary as well so we can query the binary we can run migrations off the binary we can serve the app off the binary that's kind of an important one it supports all to go tags LD Flags environment variables everything like that entire tool chain is one binary to rule them all now whatever you know I don't want to be here either you just tell the organizers we had a talk and enough okay let's do a little demo shall we so for our demo we're going to bring up someone from EA to demo their really boring game for the next ten minutes I really hate those Apple demos they're the worst they're so bad oh my things over there okay am i close to it here we go and there's my mouse Oh like I saw something computers are hard there you go there we go where's the mirroring option anybody see it Oh arrangement thank you yeah there we go okay fabulous so let's start a new application here so petals' ins name just popped up bigger how's that okay so there you it's the buffalo new command all apps start with a buffalo new and you can see we've got a ton of flags here to skip yarn skip webpack skip pop docker you can do non multi standard database type Postgres MySQL sequel Lite you can skip that entirely you can do just the API which makes it just aged like JSON API and gets rid of all templating and fun stuff like that I don't know why you would but you could but let's create a new Buffalo app here called golang UK that sounds good here we go this is gonna go get a few things go import step oh we have a console in Buffalo so you knew Buffalo console and get in there and you can talk to your models and stuff like that which is kind of fun and the console is getting a big rewrite as well we're not gonna keep using gore we're gonna we've got a big rewrite in the works so now I'm gonna installed a bunch of front-end packages here there we go I've created my whole application I've created a ton of files I've actually done a get in it and if I go into the application here was it golang UK not go lonk there we go I can't type standing up why they make people type soon you know this is what your default Buffalo application looks like hard to read in the back but you shouldn't sat in the back plenty of space up front I don't know why you'd be back there yeah we've got a couple dot files here but we've got actions as well all our handlers are gonna go this is how we're gonna handle all of our requests our assets is where our style sheets are Java scripts are s CSS our images whatever we want gonna go in there are grips these are these little tasks we get to run here locales for internationalization models for our database stuff node modules cuz its node I don't know what they did they put stuff in there don't look it's scary public folders of all your assets gets compiled and then templates that's where all of our templates should go so first thing I like to do well the first thing I usually do well I don't do because I'm awesome he's configure my database yeah Mel file to talk to my database make sure that's it's set up correctly so if we look at that here for me this is 100% set up correctly surprise it works fine on my machine but yeah you can figure your username your password your hosts all that sort of stuff and once you've done that you can run the nice DB create - all command they rego - I've created my production development and test databases all created for me I could start my application here there we go it started on port 3000 and if I go to port 3000 my assets have compiled there we go whoo a buffalo fantastic be pretty boring if that was it that wouldn't it be but this is kind of interesting I love this feature this is just the homepage but we can show this on the console - I'll actually show it on a console looks I think it's cooler there Buffalo tasks routes here we go here's a list of all of our routes method get' slash there are no aliases for this route the helper name that you can use in your templates there's route path and this is the handler that tack actually handling that which is kind of cool so I can just very simply look and say who is handling that particular thing and it gives me the actual like full path name to it which you won't see in a lot of other places okay so we've got an app running here but that's not that interesting let's actually do something here let's uh do some database stuff shall we yeah I love I love your enthusiasm you like yes mark let's create a new resource and we'll call this widget and widget will have a name and it'll have a body which is of type text if I run that there we go I've created a whole bunch of code I've created actions an entire set of crud actions to handle my resource I've said it created a whole entire set of templates to handle my resource I have also created models to handle my resource I have created migrations to handle my resource and now I can run Buffalo DB migrate there we go I've created my database it's my table in my database and we if we go back here and restart there we go starts up everything here I go back ok now I have a whole bunch of widgets stuff in my routing table if you don't believe me that that actually exists and we'll look at some of this code in a second here here we go here's my widgets and I create a new widget and if I hit save ooh I think a validation errors fancy fancy pants hello world nice to see you yeah I could save it Wow a database backs widget fantastic did that in about what 10 seconds not even which is pretty cool we also it's a nice log output here but let's actually look at some of this code what actually happened there most of the stuff that you're interested in is going to be in actions your actions folder and here is the actions app folder the actions app this is where most of your life lives in a buffalo application you create a new buffalo application give it a few configurations by default we have two different types of buffalo applications automatic and standard never use standard it's a stripped down version of automatic and I don't know why you would use it but we have it just because we had some middleware like the session saver so we automatically save your sessions so you don't have to keep doing it in your code anymore parameter logging CSRF middleware kind of all set up for us I like to wrap all my requests in a translate database transaction you don't have to internationalization handler asset Handler and then finally our widgets resource right down here at the bottom so all that was generated for us by Buffalo by their generator commands but you own this code and that's important to understand this isn't like Goa or something like that where you have to keep continually regenerating stuff once you Genet that's it we're kind of like here is the base for you to work with this is your application not ours do what you need to and if we look at the widgets like spell widgets we just go here we go this is the action this is the resource that we generated so you can see here's some nice list information so we go we get all the list we have pagination set up for you by defaults so we can paginate all your widgets but you go in here and you change this and you do this you build your business logic we're just trying to get you started we want you to have that beautiful win remember we want you to start getting too busy getting to your business logic as fast as possible and giving you as much information as we can to do that and you can go through and you could see all the other fun stuff that's happening in there and we have a widget model somewhere if I can type here we go here's my widget model that was generated you you IDs you can use int but I recommend you you IDs I think they're better for a lot of reasons we've got Auto manage created and updated apps for you here's our name there's our body some nice string stuff a collection type we even try to start adding validations for you based off what you typed in that command line because you said that you wanted what a title and a bar name and a body and you didn't say there were no lights so we say okay well they obviously have to be present that's where those validation errors came from and then you could go down there's different validations for different action types like if you've saved it if you've updated it that sort of thing and now let's look at templates new here's our new page for our template with this lovely form for helper here for anybody familiar with rails this is the plush templating library by the way hands down the most powerful templating system brian's going oh yeah no other go templating system is this powerful and I really truly saying that not just because I wrote it but that's part of it hey it was named after an awesome song from the 90s what STP series are formed for for a widget and it goes to the widgets path and it's a method type post and we've got a partial support here if we look at the form for it there we go we got nice things like input tags and text areas and all sorts of stuff and this handles all of our CSRF all of our error handling if we go back to say edit a widget and we inspect the HD let's not do that let's do a view source that's the thing view source the people still view source maybe not know I click on the page now see look it's oh show page source not view page source oh it's still the same damn inspector I was lame there we go and go away there we go and there we go that's what I was looking for just give you an idea of the generated form you see it's got IDs and methods and authenticity token there which is our CSRF token someone I think it goes off the screen and all that sort of stuff there yeah so this is all built-in this was all free for you to just go and use and do with as you please but this isn't enough wait how much how are we doing for time we've got ten minutes someone know Tam thank you I'm just gonna keep doing this till someone responds because this apparently means show me the time I know sign language that's not true at all let's uh let's actually deploy I clearly don't know anything about sign language let's deploy this app and then we'll do some more fun stuff with it hopefully if we still at some time here so I am going to use the buffalo Heroku plug-in I know and have you used this yet now and if I do buffalo Heroku set up here we go it's gonna start creating a buffalo app or app for me set the go canned go ian vida production set a session secret for me it's creating a database for me Saturday up SendGrid for me because typically when I set up an app I want all the bells and whistles Redis and that sort of stuff I could have skipped some of this stuff but anyway they said this is an unofficial plugin this is a plugin by the way but I don't want to sit here and type all the stuff out while you're watched uh there we go okay so it's setup Heroku for me it's building my docker container that was built that was generated for me in Buffalo and now it's doing yarn stuff for all that JavaScript I've added it's linking dependencies building fresh packages it's sad it's like the D acid stuff takes so much longer than the ghost stuff and we're almost done there there we go okay we are making sure we have all of our dependencies we are building the binary here now we're in the go Buffalo build world here I'm gonna build a statically linked binary with the - - static flag there we go it's building everything there are all assets got built production great now we've moved it into Alpine we using multistage docker here we are pushing to Heroku hopefully pushed come on come on Wi-Fi here we go we're running our migrations on Heroku I remember this is actually all happening inside an alpha alpine container has just my binary in it it has zero other files there we go I've migrated my database here's my database config it's gonna open up my brand-new Heroku app here hmm look at that right wow that's pretty cool and then I go to my widgets there we go and I can create a new widget and this is all working just fine all right that's an easy pleasant experience for anybody probably not the experience you had trying to write a go app for the very first time I've generated a ton of code admittedly but writing these code writing this code is not that complicated if we go back really quick to the home handler here this is a pretty good example of what a buffalo handler looks like they're really simple and whether you agree with the a concept of them being simple or not we can definitely take that offline Florin and I had a law have had long discussions both online and offline about this not being a kind of standard go type you know do use standard go handler but the reason it's not is because we want trying to make this as easy as possible for everybody absolutely is dead simple possible for new people coming in and this is as poss as simple as we can possibly get it you have a handler you take a context to return an error and we will handle the error for you we give you ways to handle the error on your own and you can easily plug in your own custom error handlers but by default we've got your back and if you don't believe me take a look at the one you're with here we go on that's a list of production isn't it let's look at this route shouldn't exist here we go here's what an error looks like in development mode for example so invalid type for UUID that not a UUID i can imagine that we could see the whole stack trace here we could see what is currently in the context of this request what are we looking at what are parameters do we get were there any form arguments and what routes do we have because maybe this is a 404 page so again it's about development we are trying to make your life as good as possible but giving you as much information as we possibly can as to what went wrong and why it went wrong and yeah and then we've got we've only got five minutes left so you know I'm actually to stop it here and take just five minutes worth of questions there's so much more I can show you but I highly encourage you to go but go to go Buffalo dot IO there's tons of great docs if you're looking for good PR Doc's are always a great first PR the blog blog go Buffalo dot IO I've got insane amounts of video and blogging content I actually have an entire 20 minute video I need to post about writing custom helpers and NGO that I posted in the selection and we have our own slack general the buffalo slack channel i posted in there the other day but it still needs to go up in the blog so check that out go to the slack channel tweet me i've got stickers by the way awesome ashley mcnamara buffalo stickers and magnets whoo no one else is giving you magnets people revell isn't giving you magnets bigos not giving you magnets IRS definitely ain't giving you magnets they'll take your magnets I really should have said that but no I didn't mean to say BAE he he will take your magnets no too far just a little bit a little bit okay okay so we got time for just like couple questions are there any questions right here in the front I could hear you it is is there a MongoDB plugin back that is an excellent question pop is does not support MongoDB currently I would love it if it could I don't know if I can or not however you can skip pop and bring to the table but you don't get is the generators that we have won't work for you however we have plugins as we saw with the Heroku one if I do you know Buffalo - - help I should have a couple plugins here right plug-in tools for deploying helpers I don't have any other plugins right now so you could absolutely right you could be the person who owns the Buffalo plug-in that supports all this stuff has nice generators and everything mm-hmm it would be awesome because I'm not doing it other questions right there not so much question but could you just show us the console working because I'm sure the console is getting a big refresh we're currently using library called door but what do we have we have widgets right so I can say you know models widget and then models DB first there we go and if I print off the widget there we go and then obviously I can update the widget I can do whatever I want with the widget but yeah we've got a new console in the works that's gonna blow this away and it's gonna also be standalone too so you could use it in your own projects not just buffalo projects but yeah you or you can currently do that we can't control it programmatically and that's our big downside with but yeah this is really cool that's one of my favorite parts and so many people don't even realize it's there yeah cool I think we got one more question time for one more right over there wait for the mic thank you my mouth nice talk thank you how can we collaborate what is the feature that you need to implement or something that you wish you have but you don't have time to do it what's the Fisher the feature I wish we had but I don't have time to do oh god I don't know there's a lot we're not there yet we're not at one oh and that's important to know I don't have a good answer for you honestly because there's a lot of things I would like to see more database support MySQL Oracle any of those things are always awesome more plugins for deploying to tools like GAE or other you know Asher whatever like I'd love to see plug-ins for that stuff but just on the 100 front we're at 0 9 3 came out this week we're not going to 1o anytime soon and that's not because we're afraid but because we want to have the same compatibility promise that go has so once we hit 100 we are going to stay with that implementation forever well not forever till - oh but we don't want to make - oh like three weeks later right we want you to have stable applications with that said Buffalo the o9o range has been incredibly stable between upgrades apps almost nothing has changed that you've needed to tweak so right now if you go from oh a 209 for example there are some changes there but they weren't even that steep actually so we're definitely leveling off yeah cool I think that's all I have time for thank you very much come find me four stickers and magnets [Applause]
Info
Channel: GopherCon UK
Views: 16,102
Rating: 4.6205535 out of 5
Keywords: golang, uk, london, computer science, google
Id: 75NjCfLLftw
Channel Id: undefined
Length: 45min 1sec (2701 seconds)
Published: Mon Sep 18 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.