Encore is the Backend Development Platform purpose-built to help you create event-driven and distributed systems.
We're excited to announce Encore v1.35, with several improvements to Encore for TypeScript!
We've also just moved the Encore Community to Discord. This gives us several key features that we believe will make the community more engaging and helpful for all members:
Hope to see you there!
We've added a new API for querying metadata about the application's running environment. It looks like this:
import { appMeta } from "encore.dev";
const meta = appMeta();
The metadata object contains tons of information about the application and where it's running:
// Describes the running Encore application.
export interface AppMeta {
// The Encore application ID. If the application is not linked to the Encore platform this will be an empty string.
// To link to the Encore platform run `encore app link` from your terminal in the root directory of the Encore app.
appID: string;
// The base URL which can be used to call the API of this running application.
//
// For local development it is "http://localhost:<port>", typically "http://localhost:4000".
//
// If a custom domain is used for this environment it is returned here, but note that
// changes only take effect at the time of deployment while custom domains can be updated at any time.
apiBaseURL: string;
// Information about the environment the app is running in.
environment: EnvironmentMeta;
// Information about the build.
build: BuildMeta;
// Information about the deployment.
deploy: DeployMeta;
}
// Describes the environment the Encore application is running in.
export interface EnvironmentMeta {
// The name of environment that this application.
// For local development it is "local".
name: string;
// The type of environment is this application running in.
// For local development it is "development".
type: EnvironmentType;
// The cloud this is running in.
// For local development it is "local".
cloud: CloudProvider;
}
// Describes what type of environment the application is running in.
export type EnvironmentType =
// A production environment.
| "production"
// A long-lived cloud-hosted, non-production environment, such as test environments, or local development.
| "development"
// A short-lived cloud-hosted, non-production environments, such as preview environments
| "ephemeral"
// When running automated tests.
| "test";
// Describes what cloud provider the application is running in.
export type CloudProvider =
| "aws" // Amazon Web Services
| "gcp" // Google Cloud Platform
| "azure" // Microsoft Azure
| "encore" // Encore Cloud.
| "local"; // Local development
// Information about the build that formed the running application.
export interface BuildMeta {
// The git commit that formed the base of this build.
revision: string;
// Whether there were uncommitted changes on top of the commit.
uncommittedChanges: boolean;
}
// Information about the deployment of the running application.
export interface DeployMeta {
// The unique id of the deployment. Generated by the Encore Platform.
id: string;
}
The encore gen client
command now accepts --excluded-services=foo,bar
to exclude specific services from the generated client.
We're also making rapid improvements to all aspects of Encore for TypeScript:
maxConcurrency
across local development, GCP, and AWSFull Changelog: https://github.com/encoredev/encore/compare/v1.34.7...v1.35.3
It's been a long time coming, but just in time for Easter it's finally here: Encore for TypeScript is now in Public Beta!
We're soon going to publish an blogpost with details on the design and architecture, but until then here are the key things to know:
Try it out yourself: Update the CLI encore version update
, create a new app encore app create
, and select TypeScript. π
Share your feedback and bug reports: We're dependent on your feedback to improve Encore, please share your thoughts either by creating an issue here on GitHub or by posting on Slack. β€οΈ
We regularly hear how Encore's approach to infrastructure automation is incredible β for the infrastructure primitives that Encore supports. This is sufficient for the majority of use cases, but when you have a use case that requires additional cloud infrastructure that Encore doesn't (yet) have built-in support for, the experience left something to be desired. To be more specific, since Encore set up the infrastructure automatically it was painful and laborious to reference those resources from Terraform, and required lots of manual work.
To solve that problem we've just released the Encore Terraform Provider that dramatically simplifies the experience of combining Encore-managed cloud infrastructure with additional infrastructure managed by Terraform.
It works by providing Terraform Data Sources for Encore-managed infrastructure resources. The data sources released so far include:
These data sources make it easy to retrieve information about the underlying cloud infrastructure that Encore has provisioned, making it that much easier to combine Encore-managed infrastructure with additional infrastructure for when you need it.
For more information on how to use the Encore Terraform Provider, check out the docs!
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Discord.
Full Changelog: https://github.com/encoredev/encore/compare/v1.31.0...v1.34.7
We're very excited to announce something the world's never seen before (probably): Test Tracing!
With Encore v1.31.0, encore test
now automatically captures a trace of every test, providing much more visibility into what's happening and making it easier to understand why a test failed.
The test traces automatically include everything you expect from Encore's automatic tracing:
And best of all: it works with all your existing tests.
Upgrade to Encore v1.31 to try it out: encore version update
We've made several quality-of-life improvements to the local development dashboard. These enhancements include the ability to view all Encore apps via the local dashboard, regardless of whether they are currently running or not. We've also made several UI improvements to the dashboard, including displaying request logs when an API call is made, notifications when the app is compiling, and notifications when the app has just restarted.
We're currently pushing to get TypeScript support out the door and hope to release the first general availability in the next few weeks. We've also been working on some smaller features based on your comments on Slack which will drop in the next few days: cloud cost insights and the ability to pause and trigger cron jobs from the Cloud Dashboard.
Check out the roadmap and leave your comments!
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Discord.
Full Changelog: https://github.com/encoredev/encore/compare/v1.30.0...v1.31.0
With v1.30.0 we're now introducing support for mocking APIs and services! This makes it much simpler to test your application in isolation.
Let's look at an example:
You have an endpoint that calls an external API in our products service:
//encore:api private
func GetPrice(ctx context.Context, p *PriceParams) (*PriceResponse, error) {
// Call external API to get the price
}
When testing this function, you don't want to call the real external API since that would be slow and cause your tests to fail if the API is down. Instead, you want to mock out the API call and return a fake response.
You can now do this in Encore by adding a mock implementation of the endpoint using the et.MockEndpoint
function inside your test:
package shoppingcart
import (
"context"
"testing"
"encore.dev/et" // Encore's test support package
"your_app/products"
)
func Test_Something(t *testing.T) {
t.Parallel() // Run this test in parallel with other tests without the mock implementation interfering
// Create a mock implementation of pricing API which will only impact this test and any sub-tests
et.MockEndpoint(products.GetPrice, func(ctx context.Context, p *products.PriceParams) (*products.PriceResponse, error) {
return &products.PriceResponse{Price: 100}, nil
})
// ... the rest of your test code here ...
}
In addition to mocking individual APIs, you can also mock entire services. This can be useful if you want to inject a different set of dependencies into your service for testing, or a service that your code depends on.
When mocking services, Encore will automatically generate an Interface
interface for every service, which contains all the APIs defined in the service. This makes it possible to automatically generate mock objects for your services using either Mockery or GoMock.
π Check out the docs for all the details.
π Remember to update using: encore version update
and go get encore.dev@latest
We've updated the docs search functionality to make it easier to find what you're looking for. Search now has improved relevancy, snippets are much improved, and results can now link directly to sub-sections of individual pages.
We're currently pushing to get TypeScript support out the door and hope to release the first general availability in the next few weeks. We've also been working on some smaller features based on your comments on Slack which will drop in the next few days: cloud cost insights and the ability to pause and trigger cron jobs from the Cloud Dashboard.
Check out the roadmap and leave your comments!
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Discord.
Full Changelog: https://github.com/encoredev/encore/compare/v1.29.7...v1.30.0
Encore v1.29 is out with a whole bunch of quality-of-life improvements and bugfixes.
As always, get the latest version with encore version update
!
We're making rapid progress on Encore's TypeScript support, and plan to have an initial release out in the coming weeks. In the meantime, join us on Slack and let us know if you're interested in participating in the private beta.
Encore now validates and autocompletes request payloads via the API Explorer and Service Catalog! Check it out in action:
https://github.com/encoredev/encore/assets/425456/4206b292-b479-4934-ab3e-708731e5d2c8
Encore now streams traces to the Encore Platform as they're happening, instead of waiting for the request to complete. This dramatically improves trace ingestion latency and reduces the memory usage of Encore applications. The new functionality is automatically enabled, starting with your next deploy. (See #944 and #976)
Encore now supports Go workspaces! This enables more seamless development of multi-module applications. (See #975)
Encore's CORS handling now automatically allows User-Agent
to be allowed for incoming requests. (See #956)
The Encore Platform now supports viewing environments that have been deleted. This is particularly useful for Preview Environments since they're automatically deleted on PR merge.
Encore now supports creating "shadow databases" for use with tools like Atlas and Prisma Migrate. A shadow database is an empty database that can be used by migration tools to compare the current state with the desired state.
Encore supports using shadow databases with the encore db
commands you already know by passing in the --shadow
flag. For example, encore db reset --shadow --all
resets all shadow databases back to their empty state, while encore db conn-uri --shadow
provides a connection string for use in tools like Atlas and Prisma Migrate.
We've updated the docs to use this functionality for a better integration with Atlas.
(See #949)
Beyond this, a whole slew of bugfixes and other improvements:
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Discord.
Full Changelog: https://github.com/encoredev/encore/compare/v1.28.0...v1.29.2
We're happy to share that Encore now supports deploying to Amazon Elastic Kubernetes Service (EKS)! π This also means you can now deploy your app to Kubernetes on both GCP and AWS.
Encore uses EKS AWS Fargate (which is a very confusing name β Thanks Amazon!) to run your Kubernetes applications using serverless compute. This removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.
To deploy your app to EKS: Go to Create Environment, select Amazon Web Services as the cloud, then select Kubernetes: EKS Fargate.
As we add more and more features to Encore, we also want to make navigation simpler and faster. We're now introducing the Command Menu as a new lightning-fast method of moving around the Cloud Dashboard (coming soon to Local Dev Dash!).β‘οΈ
Try it out yourself by opening your app in the Cloud Dashboard and pressing β+K (Mac) or Ctrl+K!
In this first release, Command Menu lets you search for pages in the Cloud Dashboard and Docs. Soon we'll add much more functionality, like the ability to search for apps, services, endpoints, and more.
We'd love to hear your feedback and ideas for how to improve it β jump on Slack and share your thoughts!
https://github.com/encoredev/encore/assets/78424526/2504ea8d-b83f-42de-bd93-d97a763cb525
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Slack.
Full Changelog: https://github.com/encoredev/encore/compare/v1.27.7...v1.28.0
π We're happy to share that the Local Dev Dash has received a big upgrade!
The main improvement is in the API explorer. It now features multiple tabs so you can work on multiple endpoints more easily, and lets you store and re-use custom requests. You can now also share these with your team members to create your own internal repository of often-used requests.
We hope these improvements will make your local development workflow smoother and faster than ever before!
Ready to try it out?
π Remember to update your CLI first: encore version update
https://github.com/encoredev/encore/assets/78424526/f1138146-8c2a-4cdc-a5dd-2eebbb3dde97
Kubernetes provides the command line tool kubectl
for communicating with a Kubernetes cluster's control plane, using the Kubernetes API.
If your Encore application has environments using Kubernetes, application Admins can now configure your local kubectl
to access your cluster automatically, without needing to fuss with IP allow lists, port forwarding, or firewall rules.
From your application directory, run encore kubernetes configure -env=[ENV_NAME]
. Then you can immediately run kubectl get deployments
or your next favourite kubectl
command.
π Remember to update your CLI: encore version update
π We continue to be overwhelmed by your support, feedback, and suggestions! Together we're building the future of backend development and we couldn't be more excited.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Slack.
Full Changelog: https://github.com/encoredev/encore/compare/v1.26.0...v1.27.0
As a first step toward full support for Neon SQL databases, we've updated Preview Environments to now provision databases using Neon. The only noticeable impact for your application is that Preview Environments are now faster to provision and start-up.
Soon we'll add support for configuring which type of database you want to use in each environment so that you can take advantage of Neon's scalable, and cost-efficient, SQL offering for all your environments.
In this release, we've rolled out a quality-of-life feature that's a real boost for your development workflow: the Open in Editor functionality.
This new feature is integrated into the local dev dashboard API explorer. It lets you jump directly to your code editor β and even better β to the exact line of code where the currently selected API endpoint is defined.
No more manual searching, no more juggling between windows. With a single click, you'll be taken straight to the relevant piece of code, so you can get right back to coding.
Have multiple editors installed? No problem! You can easily configure which code editor you'd like to use as your default.
We hope this small feature will improve your development experience starting today!
encore app init
by @eandre in https://github.com/encoredev/encore/pull/861
Full Changelog: https://github.com/encoredev/encore/compare/v1.25.2...v1.26.0
We've just released Encore v1.25 which comes with several large build & test performance improvements!
As always, update with encore version update
.
Encore's CI system now uses a brand-new streaming cache system. Previously Encore tar and untar-ed the build & test cache, adding to the build time and leading to an unfortunate trade-off between cache hit rate and cache restore/save times.
With this release, Encore now uses a streaming cache that on-demand downloads and uploads individual cache entries. This entirely removes the cache restore/save steps, leading to a substantial speed-up. Additionally, the improved cache accuracy leads to more parts of the build being cached, further improving build times.
We've seen up to a 70% reduction in build & test times for many real-world applications, depending on the nature of the change.
We've further optimized how Encore's code generation works, leading to improved build & test times, particularly when the changes are small (compared to the previous build). Depending on the change this new release should offer a 10% to 100% reduction in build times (yes, you heard that right!), and similar improvements to test execution speeds through improved test caching.
Additionally, we've further improved the Live Reload speed by improving the graceful shutdown process. More on that below.
Encore now implements a more optimized graceful shutdown process, reducing shutdown times when there are no outstanding requests being processed. Encore also provides the encore.dev/shutdown
package that allows services to opt-in to more detailed information about the shutdown process, by implementing shutdown.Handler
on a service struct.
The old signature (func (*Service) Shutdown(force context.Context)
) is still supported for backward compatibility.
β€οΈ As always, we're excited to hear what you think! Please share your feedback on Slack.
We're excited to announce Encore v1.24 which comes with several new features! As always, upgrade with encore version update
.
Encore now supports configurable bundling/unbundling of services when deploying to your own cloud. When creating a new cloud environment you can decide whether all services should be bundled together into a single deployment, or split into one deployment per service.
Bundling services improves API call performance and reduces latency between them, but removes the ability to scale them independently. Typically for Kubernetes and AWS Fargate you'll want each service deployed separately, whereas for GCP Cloud Run to bundle them together, but it depends on the use case.
Under the hood Encore already supports mixing and matching between these two modes, enabling specific services to be co-located in whatever ways you wish according to performance requirements. In the future these knobs will be exposed directly in the UI, but let us know if you want to customize the setup until then.
Encore v1.24 includes support for the newly released Go 1.21, which includes a whole slew of improvements. Check out the official release notes for more information.
The infrastructure page now lists database users and allows decrypting and viewing the database password (for admins).
encore rand
Encore now contains a set of CLI utilities for generating random data of various kinds. This is useful for generating cryptographically secure random data for things like secrets. For example:
encore rand bytes 32
(in various formats with -f hex|base32|base64|etc
)encore rand words 8
(for passphrases or such)encore rand uuid
(defaults to v4, override with -1|-4|-6|-7
)Right now we're working on adding support for deploying to Kubernetes on AWS, gRPC, and much more. Remember to vote on your favorite feature on the roadmap!
As always, if you have questions or feedback, tell us on Slack or just email us at [email protected]. Weβre excited to hear your feedback! β€οΈ
Catch you in the cloud, The Encore team