Releases: livebud/bud
v0.2.8
- Added beta support for
generator/
andtranspiler/
generators. Docs coming in a later release, but you can look at the tests for example usage if you're feeling adventurous. - Added better support for type aliases to dependency injection.
- Fixed an issue where transition state between changes in the controller would
lead to the generated controller getting removed.
v0.2.7
v0.2.6
This is a very big release. From the outside, not much has changed, but the internals have been almost entirely re-written.
This feels like the right architecture for the next couple of years. You can expect smaller release cycles with more rigorous change logs going forward.
Unfortunately I can't account for all the user-facing changes from this large release. I'm not aware of any breaking changes, but a lot of code shifted.
Please give the upgrade a go and open an issue if you run into anything!
v0.2.5
v0.2.4
- Partial support for auto-incrementing the port if already in use (#250)
- Fix
staticcheck
problems and integrate into CI (#263) - Add support for Go 1.19 (#262)
bud tool ...
now support-C
chdir support (#255)- Auto infer module when
bud create
outside $GOPATH (#242) (thanks @012e!) - Add console.error, console.warn, setTimeout, setInterval, clearTimeout and clearInterval to V8 (#233)
v0.2.3
v0.2.2
-
BREAKING: fix numerous protocol bugs between controllers and views (#203)
This was mostly around nested views. A lot of this was undocumented and so we finally started testing behaviors. You may need to adjust what your views export if you were heavily relying on nested controllers / views
-
Add scaffolding support for remaining controller actions: create, update, delete, edit & new (#203)
You can now call
bud new controller posts create update delete edit new show index
and scaffold all 7 controller actions. -
Trigger full reloads on non-update events (#212)
Now if you rename, delete or add Svelte views, the watcher will pickup on these changes and trigger a reload.
-
Add support for method overriding in
<form>
tags (#203)This allows you to submit PATCH, PUT and DELETE requests from forms using the
_method
parameter.<form method="post" action={`/${post.id || 0}`}> <input type="hidden" name="_method" value="patch"> <!-- Add input fields here --> <input type="submit" value="Update Post" /> </form>
-
Test that you can import Svelte files from node_modules (#221) thanks to @jfmario!
This release tested that you can indeed install and use Svelte components from the community like
svelte-time
and Bud will pick them up. -
Support controllers that are named Index and Show (#214) thanks to @jfmario!
Prior to this release, you couldn't create a controller in
controller/index/controller.go
because it would conflict with theIndex
action. Now you can. -
Escape props before hydrating (#200)
This allows you to pass raw HTML that could include a
<script>
tag as props into a Svelte view and have the rendering escaped.
v0.2.1
v0.2.0
-
Improve support for injecting request-specific dependencies (#181)
In v0.2.0, you can now create controller dependencies that have access to the request and response and are scoped to the request-response lifecycle.
package controller // Flash is a session flash that could be in a separate package type Flash struct { Writer http.ResponseWriter } func (f *Flash) Set(msg string) { http.Cookie(f.Writer, &http.Cookie{ Name: "flash", Value: msg, }) } // Based on: https://www.alexedwards.net/blog/simple-flash-messages-in-golang func (f *Flash) Get() string { c, err := r.Cookie(name) if err != nil { return "" } http.SetCookie(f.Writer, &http.Cookie{ Name: name, MaxAge: -1, Expires: time.Unix(1, 0), }) return c.Value } type Controller struct { Flash *Flash } func (c *Controller) Create() (*User, error) { // ... create the user c.Flash.Set("Successfully created a user!") return user, nil } func (c *Controller) Show(id int) (*Page, error) { // ... load the user page := &Page{ User: user, Flash: c.Flash.Get() } return page, nil } // Note: in the future, there will be a way to access the flash from views // without needing to pull it out and add it to your props. // See: https://github.com/livebud/bud/pull/185 for more details. type Page struct { User *User Flash string }
It may seem like if you had a database client within the
Session
it will be re-initialize the database for every request. This is not the case.Dependency injection uses a technique called hoisting to avoid re-initiazation of dependencies that don't depend on the scoped parameters (in this case
*http.Request
andhttp.ResponseWriter
). -
Add rudimentary redirects on form submissions that have errors
Prior to this release, form errors would return a JSON response even if you submitted from an HTML page.
In this release, we now redirect back to the page that submitted the form. You don't yet have access to what failed. This will come in a future release.
-
Add
bud tool bs
for starting the local bud serverThis is helpful for hacking on your generated bud files without the generators clobbering your changes. See this section in the contributing guide for more details.
-
Use a more .gitignore compliant matcher.
The previous matcher just used globbing, but .gitignore has a more sophisticated way of ignoring files. For example
bud/
will ignore all inner files. This is something the previous matcher didn't understand.This fixes some watch looping due to an unexpected failure to match a
.gitignore
line item.