encore

Encore is the Backend Development Platform purpose-built to help you create event-driven and distributed systems.

MPL-2.0 License

Downloads
5.9K
Stars
4.7K
Committers
68

Bot releases are hidden (Show)

encore - v0.16.3: UX Improvement Bonanza!

Published by eandre about 3 years ago

Encore now has much improved documentation, and an improved encore run experience!

Revamped Documentation

  • Reworked documentation site from the ground up
  • Open sourced docs so anybody can contribute to better docs
  • Added documentation search
  • Improved CONTRIBUTING.md instructions

Improved encore run experience

We added more real-time feedback about what Encore is doing when starting up. This especially helps when starting to use Encore and there's lots of things happening (compiling the Go standard library and all app dependencies, pulling docker images for PostgreSQL, creating the database, etc) that take time. See screenshot below!

Minor improvements and bugfixes

  • Added support for GitHub Codespaces (#54)
  • Encore now recognizes both Authorization: Token foo as well as Authorization: Bearer foo for authentication
  • Added ENCORE_DAEMON_DEV=1 to make it easier to develop the Encore daemon
  • Fixed Windows terminal handling (#56)
  • Fixed building from source on Windows (#57)
  • Fixed json.RawMessage handling in generated TypeScript client (#73)
  • Fixed API Explorer sometimes inferring the wrong HTTP method (#74)
  • Fixed incorrectly passing in HTTP body for GET requests (#45)
  • Fixed API Explorer default payload for float64 (#43)
  • Fixed CORS headers for less common HTTP methods
  • Fixed int and uint handling in the API Explorer

Contributions and thanks

  • @vilhelmmelkstam for his numerous bug reports and bug fixes!
  • @frzam for fixing several bugs related to Windows and terminal handling!
  • @mvp-joe for lots of great feedback and bug reports over in Encore's Slack community
  • And thanks as always to everybody for helping make Encore great.
encore - v0.16.2: RESTful API support

Published by eandre over 3 years ago

Encore now has support for defining RESTful APIs in an easy, powerful way!

API Paths

Defining APIs can now include the path=/foo/bar and method=FOO parameters to customize the HTTP path and method the API is exposed at:

type CreateOrderParams struct { /* ... */ }
type Order struct { /* ... */ }    

//encore:api public path=/orders method=POST
func CreateOrder(ctx context.Context, p *CreateOrderParams) (*Order, error) { /* ... */ }

Path parameters

You can also define custom API path parameters such as path=/orders/:id.

When you specify a parameter, Encore passes that parameter directly to your function as a separate argument, like so:

type Order struct { /* ... */ }    

//encore:api public path=/orders/:id method=GET
func GetOrder(ctx context.Context, id int) (*Order, error) { /* ... */ }

Encore automatically performs validation of the parameter, according to the type used in the function signature.
In this case id must be an integer. You can also use string, bool, uint8, and so on. You can even use encore.dev/types/uuid.UUID if you want to receive UUIDs.

Conflicting paths

Encore parses all the APIs in your application and ensures they don't conflict. For any given API call there can only ever be zero or one API that matches. If you define paths that conflict, Encore raises a compilation error.

Making API calls between services

Like always, Encore makes it easy to do API calls between services, and these parameterized APIs work just as easily as before: just call the function: service.GetOrder(ctx, 5).

Secrets Management

Encore's web platform now provides much-improved secrets management support. You can view, update, and roll back secrets to previous versions.

Contributions

  • Many thanks to @Willyham for initiating the custom API path support and implementing a large part of it!
encore - v0.15.0: Custom API paths

Published by eandre over 3 years ago

Encore now supports customizing the HTTP path of API raw endpoints. The next release will include complete support for all types of API endpoints.

//encore:api public raw path=/hello/:name
func Greet(w http.ResponseWriter, req *http.Request) {
    name := strings.TrimPrefix(req.URL.Path, "/hello/")
    fmt.Fprintf(w, "Hello, %s!", name)
}
encore - v0.14.0: Improved tracing

Published by eandre over 3 years ago

Encore now includes even better Distributed Tracing support out of the box!

Stack traces

Stack traces are incredibly useful for debugging, but common wisdom is that they're too slow to collect at scale.
Encore's deep integration across the stack enabled us to do this in a highly performant way, by only snapshotting
program counters at runtime and mapping it to source code information when the trace is viewed.
This enables Encore to collect stack traces in less than 300ns!

The end result is that Encore now provides complete stack traces for all events, including API calls, database queries, log messages, and so on.

Automatic HTTP Tracing

Encore now also includes automatic tracing of outgoing HTTP requests. This also works out of the box, and works for all HTTP calls using Go's standard library net/http package.

Hope you enjoy the new release!

encore - v0.13.1: Error handling bonanza!

Published by eandre over 3 years ago

Encore now has great built-in support for API errors. Features include:

  • Return errors with specific HTTP status codes
  • Return structured errors, along with structured additional details
  • Support for key-value metadata that is propagated between services

All of this is made possible using the encore.dev/beta/errs package.
Read all about it in the Encore docs!

encore - v0.12.0

Published by eandre over 3 years ago

Encore now adds structured log messages to the automatic tracing, using encore.dev/rlog.
Log messages written during traced requests are automatically added to the trace.

The structure of additional fields is preserved, allowing us to index and filter by structured log context later!

encore - v0.11.1

Published by eandre over 3 years ago

This release fixes a few minor issues discovered following the open-source release:

  • Fix encore db shell for local development
  • Add log message when a request to an auth endpoint lacks an Authorization header
  • Improved help for encore gen client
  • Other miscellaneous fixes