Encore is the Backend Development Platform purpose-built to help you create event-driven and distributed systems.
MPL-2.0 License
Bot releases are hidden (Show)
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
Published by eandre 7 months ago
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
Published by DomBlack 9 months ago
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 Slack.
Full Changelog: https://github.com/encoredev/encore/compare/v1.30.0...v1.31.0
Published by marcuskohlberg 9 months ago
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 Slack.
Full Changelog: https://github.com/encoredev/encore/compare/v1.29.7...v1.30.0
Published by eandre 11 months ago
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 Slack.
Full Changelog: https://github.com/encoredev/encore/compare/v1.28.0...v1.29.2
Published by marcuskohlberg 12 months ago
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
Published by marcuskohlberg about 1 year ago
🎉 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
Published by marcuskohlberg about 1 year ago
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
Published by marcuskohlberg about 1 year ago
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.
Published by eandre about 1 year ago
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
Published by eandre about 1 year ago
We're excited to announce Encore v1.23 with several new features! As always, upgrade with encore version update
.
Encore now allows you to create and switch between multiple, independent infrastructure namespaces. Infrastructure namespaces are isolated from each other, and each namespace contains its own independent data.
Create and switch to a new namespace with encore ns switch --create NAME
. Commands like encore run
, encore db shell
and so on automatically use the active infrastructure namespace (override this with -n).
Infrastructure namespaces makes it trivial to switch tasks, confident your old state and data will be waiting for you when you return. If you've ever worked on a new feature that involves making changes to the database schema, only to context switch to reviewing a Pull Request and had to reset your database, you know the feeling.
Read the docs to learn more about infrastructure namespaces, and let us know what you think over on Slack!
Databases provisioned by Encore now support the popular pgvector and PostGIS extensions! This is powered by the new encoredotdev/postgres:15
docker image. The extensions are supported across the board: for local development; in Encore's CI/CD pipeline when running tests; in new databases provisioned in Encore Cloud; and in cloud databases in AWS and GCP.
Let us know on Slack if there are any more extensions you would like to see!
sqldb.NewDatabase
(#822
--example=empty
(#821)encore gen wrappers
to better work with first-time use during CI/CD workloads (#815)We rely on the community to improve Encore, and we continue to be overwhelmed by your support and encouragement.
Thank you Juan Álvarez, Will Demaine, Jakob Nordfeldt, MaxD, and Jamie MacLeod for your ideas in the new #suggestions Slack channel! ✨
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
Published by marcuskohlberg over 1 year ago
Encore now supports deploying to existing Kubernetes clusters on Google Cloud Platform. 🎉
This means, if you have a pre-existing Kubernetes cluster, it is now much easier to adopt Encore. You can simply deploy your Encore application to your pre-existing cluster alongside your other applications.
To import a cluster: Go to Create Environment in the Cloud Dashboard, select Kubernetes: Existing GKE Cluster as the compute platform, and finally specify your cluster's Project ID
, Region
, and Cluster Name
.
We've finally added support for receiving webhooks from the Encore Platform!
Admins can manage webhooks by going to: Settings > Integrations > Webhooks in the Cloud Dashboard.
The initial set of webhooks center around rollouts, providing notifications related to builds, infra provisioning, and deployments. Use cases for these events include:
To make it easier to consume webhooks, we've published a Go module (go.encore.dev/webhooks
) that provides type definitions and documentation of the various events. We'll keep this updated over time as we add support for additional webhook events. For security reasons, Encore provisions a dedicated secret key for every webhook and signs every webhook request with said key. The provided webhooks.ParseEvent
validates the webhook signature as part of its processing, ensuring the webhooks are coming from Encore and not elsewhere.
We rely on the community to improve Encore, and we continue to be overwhelmed by your support and encouragement.
Thank you Juan Álvarez, Will Demaine, Jakob Nordfeldt, MaxD, and Jamie MacLeod for your ideas in the new #suggestions Slack channel! ✨
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
Full Changelog: https://github.com/encoredev/encore/compare/v1.21.2...v1.22.0
Published by marcuskohlberg over 1 year ago
As with all things Kubernetes, this release took a lot of work!
Finally, we're happy to share that Encore now supports deploying to Kubernetes on GCP (AWS is coming soon).
Here's what you need to know:
As always, remember to update your CLI: encore version update
– We're looking forward to hearing your feedback on Slack!
In case you didn't know, Encore lets you require admin approval for deploys that make changes to infrastructure.
We've just shipped some improvements to make this workflow better:
The Encore CLI now supports logging in from a different device than where your browser is running, using encore auth login. (The new flow is powered by OAuth2's device authorization standard.) This adds better support for use cases like developing over SSH, and using WSL, GitHub Codespaces/Gitpod, etc.
Remember to update your CLI: encore version update
Encore now supports configurable Pub/Sub concurrency on a per-subscriber basis, using the MaxConcurrency
field in the pubsub.SubscriptionConfig
. The default value, if not set, is a reasonable default based on the cloud provider. See the package docs for more information.
We rely on the community to improve Encore, and we're overwhelmed by your support and encouragement. Thanks to Neal Lathia, Peter Stewart, Luka Giorgadze, Simon Vans-Colina, Phakorn Kiong, Hussein Badakhchani, Brent Dillingham, Jakob Nordfeldt, and Will Demaine for your ideas, bug reports, and feedback!
Right now we're working on adding support for deploying to existing Kubernetes clusters, 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,
Marcus & the Encore team
Full Changelog: https://github.com/encoredev/encore/compare/v1.21.0...v1.21.1
Published by marcuskohlberg over 1 year ago
It's been a long time coming, but it's finally here: Infrastructure configuration directly from the Encore Cloud Dashboard!
You can now easily configure your AWS and GCP environments' infrastructure settings, including: compute instances, database clusters, and Redis clusters. When you make changes Encore automatically validates the configuration according to each cloud provider's constraints and applies the configuration during the next deploy. This makes it much simpler to manage and track changes as your needs evolve.
https://github.com/encoredev/encore/assets/78424526/577b252a-a62e-4b19-be47-d9d7ae04fb9b
It's about time the local dev dash got some care and attention. We've made some major upgrades behind the scenes and it now shares most of its components with the Cloud Dashboard. This means it's now also got the latest and greatest functionality like the improved API Explorer and Service Catalog. It'll also make it faster to release further improvements, so expect more to come!
As part of our ongoing work to add support for gRPC (more on that soon!), we've taken the opportunity to make some quality-of-life improvements to tracing:
https://github.com/encoredev/encore/assets/78424526/c1f31126-c853-4802-9fc3-96e3e5c83884
We get many questions about using GraphQL in Encore applications. So we've recently published a tutorial on how to build a GraphQL API. We hope you enjoy trying it, and find it helpful when using GraphQL. There is also a GraphQL example app in the example apps repo.
This release brings several other significant improvements:
fetch
options in the generated TypeScript/JavaScript clients (#737). Thanks @PhakornKiong for the contribution!pubsub.MethodHandler
) (#739)encore:"optional"
in the generated clients (TypeScript, JavaScript, OpenAPI) (#726)Right now we're working on adding support for deploying to Kubernetes, gRPC, and much more.
Stay tuned and please vote on your favorite feature on the roadmap!
As always, if you have questions, tell us on Slack or post on the Community Forum.
We’re excited to hear your feedback! ❤️
Full Changelog: https://github.com/encoredev/encore/compare/v1.19.0...v1.20.0
Published by eandre over 1 year ago
We're excited to announce Encore v1.19.0 which brings a highly requested feature: support for message ordering in Pub/Sub!
Ordered topics ensure messages are delivered to subscribers in the order they were delivered (for messages that share the same ordering key). This can make it easier to implement certain use cases where message ordering is important.
Message ordering is not a free lunch and reduces message delivery throughput. To maintain topic order, messages with the same ordering key aren't delivered until the earliest message is processed or dead-lettered, potentially causing delays due to head-of-line blocking. For more information see the docs.
To create an ordered topic, define a message attribute to be used as the ordering attribute. For example:
import "encore.dev/pubsub"
type CartEvent struct {
ShoppingCartID int `pubsub-attr:"cart_id"`
Event string
}
var CartEvents = pubsub.NewTopic[*CartEvent]("cart-events", pubsub.TopicConfig{
DeliveryGuarantee: pubsub.AtLeastOnce,
OrderingAttribute: "cart_id",
})
Remember to first update to the latest version of Encore using encore version update
, and update your dependency on encore.dev
within your app so your IDE sees the new configuration option, using go get -u encore.dev@latest
.
We're working on adding more flexibility in controlling underlying infra for individual services, deploying to Kubernetes, and much more. We're also working on bringing a bunch of improvements to the local development dashboard.
Stay tuned and please vote on your favorite feature on the roadmap!
As always, if you have questions or feedback, tell us on Slack or post on the Community Forum.
We’re excited to hear your feedback, and happy Pub/Subbing! ❤️
Published by marcuskohlberg over 1 year ago
We've been hard at work for a little bit on this one, and it's finally here!
Now when you create a Pub/Sub topic, you can specify an exactly-once delivery guarantee:
var Signups = pubsub.NewTopic[*SignupEvent]("signups", pubsub.TopicConfig{
DeliveryGuarantee: pubsub.ExactlyOnce,
})
This provides a much stronger guarantee, backed by the cloud infrastructure used to run your app, that a message published will not be delivered multiple times to your application's subscriptions if processed without an error.
For more information checkout the docs.
Remember to first update to the latest version of Encore using encore version update
, and update your dependency on encore.dev
within your app so your IDE sees the new option using go get -u encore.dev@latest
.
We plan to add support for ordered topics in the coming releases, which will allow you to process events in the order they were published based on a grouping key (e.g. user ID or order ID).
Full Changelog: https://github.com/encoredev/encore/compare/v1.17.0...v1.18.0
Published by eandre over 1 year ago
May is here and here in Sweden we survived the yearly ritual bonfire night unscathed. We're excited to announce Encore v1.17.0 which brings even more features! As always, update with encore version update
, or head over to the install docs to install Encore.
One of the hardest parts of building an event-driven application is ensuring consistency between services. A common pattern is for each service to have its own database and use Pub/Sub to notify other systems of business events. Inevitably this leads to inconsistencies since the Pub/Sub publishing is not transactional with the database writes.
To better handle such use cases, Encore now provides a utility package for implementing the Transactional Outbox pattern. To use it make sure you're on Encore v1.17.0 (this release), then read up on the docs.
We've spruced up the code viewer over on the Cloud Dashboard. With this update, you now get cross-links to jump between code and the Service Catalog and Tracing. This makes it super quick to navigate between code and API Docs / Traces to see how everything connects. Check out the video below, or head over to the Uptime demo app to see it for yourself.
https://user-images.githubusercontent.com/425456/235785049-1dd4ec7b-0866-448a-87f1-5737be6a490e.mp4
Encore now supports creating databases using the new sqldb.NewDatabase
, bringing the encore.dev/storage/sqldb
package in line with the other infrastructure resources. This approach to creating databases is more explicit and better allows for future extensibility than the previous behavior (which implicitly created a database based on the presence of a migrations
folder).
Encore now supports defining most infrastructure resources in _test.go
files, allowing tests to declare their own infrastructure resources. This allows library code that operates on infrastructure resources to be more easily tested (normal infrastructure resources can only be defined within Encore services). For an example of such a use case see the new transactional outbox tests.
On a related note, most encore db
commands now take an optional --test
flag to connect to test databases.
The encore gen client
command now supports filtering which services to be included in the output with the new --services
flag. Thanks @jdbann for the suggestion!
We rely on the community to improve Encore, and we continue to be humbled by your incredible support and encouragement. We've had a huge influx of suggestions and feedback recently, so a huge thank you to everyone. In particular, thanks to John Bannister, Juha Ristolainen, Che Sampat, Vilhelm Melkstam, Steven Edwards, Rafal Glowka, George Arscott, and George Antoniadis!
We're working on adding more flexibility in controlling underlying infra for individual services, deploying to Kubernetes, and much more. We're also working on bringing a bunch of improvements to the local development dashboard.
Stay tuned and please vote on your favorite feature on the roadmap!
As always, if you have questions or feedback, tell us on Slack or post on the Community Forum.
We’re excited to hear your feedback! ❤️
Published by eandre over 1 year ago
Spring is here and you know what that means! We're excited to announce a series of quality-of-life improvements to the Encore developer experience!
Cookies can now be used in auth handlers, offering an easy way to authenticate requests via cookies:
type MyAuthParams struct {
// SessionCookie is set to the value of the "session" cookie.
// If the cookie is not set it's nil.
SessionCookie string `cookie:"session"`
}
//encore:authhandler
func AuthHandler(ctx context.Context, p *MyAuthParams) (auth.UID, error) {
// ...
}
To set and read cookies in Encore APIs, use a raw endpoint.
Encore uses static analysis to determine which services are publishing messages to what topics. That information is used to provision infrastructure correctly, render architecture diagrams, and configure IAM permissions. This means that *pubsub.Topic
objects can't be passed around however you'd like, as it makes static analysis impossible in many cases.
To better support use cases like passing topics to library code or using them with dependency injection, Encore now supports the ability
to get a Topic Reference that can be passed around any way you want:
var Signups = pubsub.NewTopic[*SignupEvent]("signups", pubsub.TopicConfig{
DeliveryGuarantee: pubsub.AtLeastOnce,
})
// Create a topic reference that can be passed around arbitrarily
ref := pubsub.TopicRef[pubsub.Publisher[*SignupEvent]](Signups)
For more information see the docs
Encore now supports defining fallback routes. Fallback routes are similar to wildcard routes,
but they are only matched if no other route matches the request. The primary use case for
fallback routes is to simplify migrating existing backends over to Encore.
With fallback routes you can define a catch-all endpoint that forwards requests to your existing
HTTP router with Encore, and then gradually move over endpoints one by one while preserving
the behavior for the remaining routes. For example:
//encore:api public raw path=/!fallback
func FallbackRoute(w http.ResponseWriter, req *http.Request) {
// Forward the request to the existing router
existingRouter.ServeHTTP(w, req)
}
As a side effect of how Encore generated code for running tests the Go compiler ended up needing
to re-link binaries for every package being tested. This caused slow compilation times and slow tests.
We've tweaked Encore's code generation to handle this better, resulting in as much as a 2-3x improvement in test execution speed in many cases!
When your API handler panics Encore now displays a much nicer stack trace compared to before, allowing you to more easily pinpoint the issue. This works both in local development (encore run
as well as the local trace viewer) as well as traces in cloud environments.
Encore now supports generating an OpenAPI specification for an API, using encore gen client --lang openapi <app-id>
. Let us know what you think about the output and if you'd like to see something improved!
sqldb.DriverConn
now offers a way to get the underlying *pgx.Conn
from a standard library *database/sql.Conn
.We rely on the community to improve Encore, and we continue to be humbled by your incredible support and encouragement. A massive thank you to Brent Dillingham, Luka Giorgadze, Simon Vans-Colina, Otar Adamia, Phakorn Kiong, George Antoniadis, Jan Brucek, and more!
We're working on adding more flexibility in controlling underlying infra for individual services, deploying to Kubernetes, and much more. We're also working on bringing a bunch of improvements to the local development dashboard.
Stay tuned and please vote on your favorite feature on the roadmap!
As always, if you have questions or feedback, tell us on Slack or post on the Community Forum.
We’re excited to hear your feedback! ❤️
Published by marcuskohlberg over 1 year ago
Thanks to your feedback, we've made these changes for a more seamless workflow:
Here's some of what we're considering next — let us know if it sounds valuable (or not):
We rely on the community to improve Encore, and we continue to be humbled by your incredible support and encouragement. A massive thank you to Patryk Siemiński, Paweł Słomka, Brent Dillingham, Emily Rymer, John Bannister, Mason Stewart, Simon Vans-Colina, Ohm Patel, Jakob Nordfeldt, and many more!
We're very close to releasing Encore's V2 parser and major speed improvements to running tests.
We're also working on adding more flexibility in controlling underlying infra for individual services, deploying to Kubernetes, and much more. Stay tuned and please vote on your favorite feature on the roadmap!
As always, if you have questions or feedback, tell us on Slack or post on the Community Forum.
We’re excited to hear your feedback! ❤️
Full Changelog: https://github.com/encoredev/encore/compare/v1.14.5...v1.15.0
Published by marcuskohlberg over 1 year ago
Having easy access to metrics is a critical part of application observability. Encore now automatically provides metrics for your application for everyday use cases such as Request rate, Memory usage, and Goroutines. These work in all environments and are accessible from the Encore Platform.
By default, Encore also exports metrics data to your cloud provider's built-in monitoring service, so you can easily use your preferred observability tools.
Encore also makes it simple to define custom metrics for your application, which automatically display in the built-in metrics dashboard. Learn more in the docs.
Many teams already use observability tools like Grafana, so we've added an easy integration to help you get all your metrics in one place. (For fans of Datadog, an integration is coming very soon!)
There's a huge list of improvements since the last release announcement. Here are some highlights:
Full Changelog: https://github.com/encoredev/encore/compare/v1.13.0...v1.14.4