GOPATH
is no longer supported.
Please see this blog post for more information https://blog.gobuffalo.io/the-road-to-1-0-requiring-modules-5672c6b015e5.
Buffalo@v0.14.5
Please read through the notes to see what is new, what has been improved, and most importantly, what might be breaking changes for existing applications.
In addition to what is listed here, it is recommended that you read the CHANGELOG for a complete list of what has changed since v0.14.4
.
How to Upgrade
Pre-built Binaries
The easiest solution is to download one of the pre-built binaries:
https://github.com/gobuffalo/buffalo/releases/tag/v0.14.5
Using Go Get
$ go get -u github.com/gobuffalo/buffalo/buffalo
From Source
$ go get github.com/gobuffalo/buffalo
$ cd $GOPATH/src/github.com/gobuffalo/buffalo
$ git checkout tags/v0.14.5 -b v0.14.5
$ make install
Once you have an upgraded binary you can run the following command to attempt to upgrade your application from v0.14.4
to v0.14.5
.
$ buffalo fix
Note: While we have done our best to make this update command work well, please understand that it might not get you to a complete upgrade depending on your application and its complexities, but it will get you pretty close.
Unified Helpers Package
Previously github.com/gobuffalo/plush
helper functions were scattered in multiple locations. These functions were hard to find, often non-exported, and poorly documented.
The new github.com/gobuffalo/helpers
has been introduced to be a single source for these helpers.
This new package is broken into categorized sub-packages with the appropriate helpers
├── content
├── debug
├── encoders
├── env
├── escapes
├── forms
│ └── bootstrap
├── hctx
├── helpers
├── helptest
├── inflections
├── iterators
├── meta
├── paths
├── tags
└── text
New PathFor Helper
The new github.com/gobuffalo/helpers/paths#PathFor
helper takes an interface{}
, or a slice
of them, and tries to convert it to a /foos/{id}
style URL path.
Rules:
- if
string
it is returned as is - if
github.com/gobuffalo/helpers/paths#Pathable
theToPath
method is returned - if
slice
or anarray
each element is run through the helper then joined - if
github.com/gobuffalo/helpers/paths#Paramable
theToParam
method is used to fill the{id}
slot - if
<T>.Slug
the slug is used to fill the{id}
slot of the URL - if
<T>.ID
the ID is used to fill the{id}
slot of the URL
New Link Helpers
The new github.com/gobuffalo/helpers/tags
package brings some new helper functions.
LinkTo
The github.com/gobuffalo/helpers/tags#LinkTo
helpers creates HTML for a <a>
tag using github.com/gobuffalo/tags
to create tag with the given github.com/gobuffalo/tags#Options
and using
github.com/gobuffalo/helpers/paths#PathFor
to set the href
element.
If given a block it will be interrupted and appended inside of the <a>
tag.
Example 1:
<%= linkTo([user, widget], {class: "btn"}) %>
<a class="btn" href="/users/id/widget/slug"></a>
Example 2:
<%= linkTo("foo", {class: "btn"}) %>
<a class="btn" href="/foo"></a>
Example 3:
<%= linkTo(user, {class: "btn"}) { %>
Click Me!
<% } %>
<a class="btn" href="/users/id">Click Me!</a>
RemoteLinkTo
The github.com/gobuffalo/helpers/tags#RemoteLinkTo
helper provides the same functionality as
github.com/gobuffalo/helpers/tags#LinkTo
but adds the data-remote
element for use with
https://www.npmjs.com/package/rails-ujs which is included in the default generated Webpack configuration.
Example 1:
<%= remoteLinkTo([user, widget], {class: "btn"}) %>
<a class="btn" data-remote="true" href="/users/id/widget/slug"></a>
Example 2:
<%= remoteLinkTo("foo", {class: "btn"}) %>
<a class="btn" data-remote="true" href="/foo"></a>
Example 3:
<%= remoteLinkTo(user, {class: "btn"}) { %>
Click Me!
<% } %>
<a class="btn" data-remote="true" href="/users/id">Click Me!</a>
Skip Build-time Dependencies
When running the buffalo build
command Buffalo may need packages that are not part of the applications directly.
For example, in order have access to runtime information in your application, the github.com/gobuffalo/buffalo/runtime
is used to provide versioning information.
There are times when you may not want/need this, for a variety of reasons.
The new --skip-build-deps
flag allows you to disable the buffalo
binary from trying to satisfy those dependencies automatically.
$ buffalo build --skip-builds-deps
Module Changes
Buffalo Library/CLI Changes
These are changes to the Buffalo library, as well as the buffalo
binary.
// gobuffalo/buffalo/go.mod@v0.14.5
module github.com/gobuffalo/buffalo
require (
github.com/BurntSushi/toml v0.3.1
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd
github.com/gobuffalo/buffalo-docker v1.0.7
github.com/gobuffalo/buffalo-plugins v1.14.1
github.com/gobuffalo/buffalo-pop v1.12.0
github.com/gobuffalo/clara v0.4.1
github.com/gobuffalo/depgen v0.1.1
github.com/gobuffalo/envy v1.7.0
github.com/gobuffalo/events v1.3.1
github.com/gobuffalo/fizz v1.8.0 // indirect
github.com/gobuffalo/flect v0.1.3
github.com/gobuffalo/genny v0.1.1
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/gogen v0.1.1
github.com/gobuffalo/helpers v0.0.0-20190506214229-8e6f634af7c3
github.com/gobuffalo/httptest v1.2.0
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2
github.com/gobuffalo/meta v0.0.0-20190329152330-e161e8a93e3b
github.com/gobuffalo/nulls v0.0.0-20190305142546-85f3c9250d87
github.com/gobuffalo/packd v0.1.0
github.com/gobuffalo/packr/v2 v2.3.2
github.com/gobuffalo/plush v3.8.2+incompatible
github.com/gobuffalo/plushgen v0.1.0
github.com/gobuffalo/pop v4.11.0+incompatible
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754
github.com/gobuffalo/tags v2.1.0+incompatible
github.com/gobuffalo/x v0.0.0-20190224155809-6bb134105960
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.7.2
github.com/gorilla/sessions v1.1.3
github.com/karrick/godirwalk v1.10.3
github.com/markbates/deplist v1.1.3
github.com/markbates/grift v1.0.6
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2
github.com/markbates/refresh v1.7.1
github.com/markbates/safe v1.0.1
github.com/markbates/sigtx v1.0.0
github.com/monoculum/formam v0.0.0-20190307031628-bc555adff0cd
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.4
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/tools v0.0.0-20190603231351-8aaa1484dc10
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
)
// gobuffalo/buffalo/go.mod@v0.14.4
module github.com/gobuffalo/buffalo
require (
github.com/BurntSushi/toml v0.3.1
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd
github.com/gobuffalo/buffalo-docker v1.0.7
github.com/gobuffalo/buffalo-plugins v1.14.1
github.com/gobuffalo/buffalo-pop v1.12.0
github.com/gobuffalo/clara v0.4.1
github.com/gobuffalo/depgen v0.1.1
github.com/gobuffalo/envy v1.7.0
github.com/gobuffalo/events v1.3.1
github.com/gobuffalo/fizz v1.8.0 // indirect
github.com/gobuffalo/flect v0.1.3
github.com/gobuffalo/genny v0.1.1
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/gogen v0.1.1
github.com/gobuffalo/httptest v1.2.0
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2
github.com/gobuffalo/meta v0.0.0-20190329152330-e161e8a93e3b
github.com/gobuffalo/nulls v0.0.0-20190305142546-85f3c9250d87
github.com/gobuffalo/packd v0.1.0
github.com/gobuffalo/packr v1.25.0
github.com/gobuffalo/packr/v2 v2.2.0
github.com/gobuffalo/plush v3.8.2+incompatible
github.com/gobuffalo/plushgen v0.1.0
github.com/gobuffalo/pop v4.11.0+incompatible
github.com/gobuffalo/tags v2.1.0+incompatible
github.com/gobuffalo/x v0.0.0-20190224155809-6bb134105960
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.7.2
github.com/gorilla/sessions v1.1.3
github.com/karrick/godirwalk v1.10.3
github.com/markbates/deplist v1.1.3
github.com/markbates/grift v1.0.6
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2
github.com/markbates/refresh v1.7.1
github.com/markbates/safe v1.0.1
github.com/markbates/sigtx v1.0.0
github.com/monoculum/formam v0.0.0-20190307031628-bc555adff0cd
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.4
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.3.0
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/tools v0.0.0-20190525145741-7be61e1b0e51
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
)
// DIFF
(
"""
... // 17 identical lines
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/gogen v0.1.1
+ github.com/gobuffalo/helpers v0.0.0-20190506214229-8e6f634af7c3
github.com/gobuffalo/httptest v1.2.0
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2
github.com/gobuffalo/meta v0.0.0-20190329152330-e161e8a93e3b
github.com/gobuffalo/nulls v0.0.0-20190305142546-85f3c9250d87
github.com/gobuffalo/packd v0.1.0
- github.com/gobuffalo/packr v1.25.0
- github.com/gobuffalo/packr/v2 v2.2.0
+ github.com/gobuffalo/packr/v2 v2.3.2
github.com/gobuffalo/plush v3.8.2+incompatible
github.com/gobuffalo/plushgen v0.1.0
github.com/gobuffalo/pop v4.11.0+incompatible
+ github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754
github.com/gobuffalo/tags v2.1.0+incompatible
github.com/gobuffalo/x v0.0.0-20190224155809-6bb134105960
... // 15 identical lines
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.3.0
- golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f
+ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
golang.org/x/sync v0.0.0-20190423024810-112230192c58
- golang.org/x/tools v0.0.0-20190525145741-7be61e1b0e51
+ golang.org/x/tools v0.0.0-20190603231351-8aaa1484dc10
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
)
"""
)
Application Changes
These are changes for a brand new application @v0.14.5
with the following command:
$ buffalo new coke
// @v0.14.5/go.mod
module github.com/markbates/coke
go 1.12
require (
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/gobuffalo/buffalo v0.14.5
github.com/gobuffalo/buffalo-pop v1.12.0
github.com/gobuffalo/envy v1.7.0
github.com/gobuffalo/fizz v1.9.2 // indirect
github.com/gobuffalo/httptest v1.4.0 // indirect
github.com/gobuffalo/logger v1.0.1 // indirect
github.com/gobuffalo/makr v1.2.0 // indirect
github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276
github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33
github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655
github.com/gobuffalo/nulls v0.1.0 // indirect
github.com/gobuffalo/packr v1.30.1
github.com/gobuffalo/packr/v2 v2.5.2
github.com/gobuffalo/plush v3.8.3+incompatible // indirect
github.com/gobuffalo/pop v4.11.2+incompatible
github.com/gobuffalo/suite v2.8.1+incompatible
github.com/gorilla/mux v1.7.3 // indirect
github.com/gorilla/sessions v1.2.0 // indirect
github.com/markbates/grift v1.1.0
github.com/markbates/oncer v1.0.0 // indirect
github.com/markbates/refresh v1.8.0 // indirect
github.com/unrolled/secure v1.0.0
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
)
// @v0.14.4/go.mod
module github.com/markbates/coke
go 1.12
require (
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/gobuffalo/buffalo v0.14.4
github.com/gobuffalo/buffalo-pop v1.12.0
github.com/gobuffalo/envy v1.7.0
github.com/gobuffalo/fizz v1.9.2 // indirect
github.com/gobuffalo/httptest v1.4.0 // indirect
github.com/gobuffalo/logger v1.0.1 // indirect
github.com/gobuffalo/makr v1.2.0 // indirect
github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276
github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33
github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655
github.com/gobuffalo/nulls v0.1.0 // indirect
github.com/gobuffalo/packr v1.30.1
github.com/gobuffalo/packr/v2 v2.5.2
github.com/gobuffalo/plush v3.8.3+incompatible // indirect
github.com/gobuffalo/pop v4.11.2+incompatible
github.com/gobuffalo/suite v2.8.1+incompatible
github.com/gorilla/mux v1.7.3 // indirect
github.com/gorilla/sessions v1.2.0 // indirect
github.com/markbates/grift v1.1.0
github.com/markbates/oncer v1.0.0 // indirect
github.com/markbates/refresh v1.8.0 // indirect
github.com/unrolled/secure v1.0.0
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
)
// DIFF
(
"""
... // 4 identical lines
require (
github.com/codegangsta/negroni v1.0.0 // indirect
- github.com/gobuffalo/buffalo v0.14.4
+ github.com/gobuffalo/buffalo v0.14.5
github.com/gobuffalo/buffalo-pop v1.12.0
github.com/gobuffalo/envy v1.7.0
... // 23 identical lines
"""
)