Skip to content

Releases: encoredev/encore

v1.41.9 - Improved Encore.ts error messages and Encore.go middleware

11 Oct 15:00
d3b31d5
Compare
Choose a tag to compare

In this release we're shipping a bunch of improvements to Encore.ts error messages, hopefully making the developer experience a lot smoother!

Remember to update Encore: encore version update

  • Improve path parsing error by @fredr in #1456
  • tsparser: better syntax errors by @fredr in #1460
  • tsparser: better errors when defining secrets by @fredr in #1461
  • tsparser: better endpoint parser errors by @fredr in #1463
  • tsparser: detect conflicting paths in endpoints by @fredr in #1465
  • Allow importing json files and handle module loader errors better by @fredr in #1459

Encore.go Middleware improvements

A small but mighty change: Incoming HTTP Request Headers are now available for introspection in middleware. This makes it simple to do things like IP rate limiting. Thanks to everyone in the community who suggested this!

Remember to update Encore: encore version update

  • runtimes/go: expose request headers for middleware by @eandre in #1469

Bounties - You can help fund community contributions

We're now set up to use Polar.sh to enable crowdfunding bounties for community driven open source contributions to Encore. If you create an issue in this repo, you can now use the label Fund and it will automatically add a Polar.sh funding badge so that you and other community members can contribute to a bounty for whoever completes the issue.

polar badge

Other improvements

Thanks to our new contributors ❤️

Tell us what you think

We love to hear your feedback, join Discord to share your thoughts and ask questions! 👋

Full Changelog: v1.41.7...v1.41.9

v1.41.7 - Minor improvements & bugfixes

03 Oct 14:48
93a9bb0
Compare
Choose a tag to compare

What's Changed

Thanks to our first time contributors ❤️

Full Changelog: v1.41.4...v1.41.7

v1.41.4 - Minor improvements & bugfixes

21 Sep 06:51
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.41.3...v1.41.4

v1.41.3 - Minor improvements & bugfixes

18 Sep 07:51
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.41.1...v1.41.3

v1.41.1 - Static assets support in Encore.ts (powered by Rust)

12 Sep 14:36
7feefda
Compare
Choose a tag to compare

Encore.ts now comes with built-in support for serving static assets (such as images, HTML and CSS files, and JavaScript files).
This is useful when you want to serve a static website or a single-page application (SPA) that has been pre-compiled into static files.

When defining static files, the files are served directly from the Encore.ts Rust Runtime. This means that zero JavaScript code is executed to serve the files, freeing up the Node.js runtime to focus on executing business logic. This dramatically speeds up both the static file serving, as well as improving the latency of your API endpoints.⚡️

Learn more in the docs
Example app showing how to serve static files

Don't forget to update your CLI:
encore version update

Example

Serving static files in Encore.ts works similarly to regular API endpoints, but using the api.static function instead.

import { api } from "encore.dev/api";

export const assets = api.static(
  { expose: true, path: "/frontend/*path", dir: "./assets" },
);

This will serve all files in the ./assets directory under the /frontend path prefix.

Encore automatically serves index.html files at the root of a directory. In the case above, that means that requesting the URL /frontend will serve the file ./assets/index.html, and /frontend/hello will serve the file ./assets/hello or ./assets/hello/index.html (whichever exists).

Other improvements & bug fixes

Thanks to our New Contributors ❤️

Full Changelog: v1.40.0...v1.41.1

v1.40: Encore.ts Streaming APIs

02 Sep 14:18
Compare
Choose a tag to compare

We're excited to announce Encore v1.40, with support for building streaming APIs in Encore.ts!

Streaming APIs

Streaming APIs are often used for building push notifications, collaborative tools, or continuous data processing.

In this release we've added support for creating streaming APIs in Encore.ts, enabling you to stream data both to and from your services using a type-safe interface on top of WebSockets.

Here's a simple example of a ping pong service:

interface Incoming {
  type: "ping";
}

interface Outgoing {
  type: "pong";
}

export const pingpongStream = api.streamInOut<Incoming, Outgoing>(
  { expose: true, path: "/ping" },
  async (stream) => {
    for await (const ping of stream) {
      await stream.send( { type: "pong" } );
    }
  }
);

See further examples and learn more in the docs.

Don't forget to update your CLI using: encore version update

New guide: Migrating from Express.js to Encore.ts for 9x performance

We recently wrote about our Encore.ts performance benchmarks, showing how Encore.ts is 9x more performant than Express.js.

Since many of you have asked, we've just published a more in-depth docs article comparing Encore.ts and Express.js. It also includes a migration guide, showing you how to migrate to Encore.ts to unlock improved performance.

📚 Check it out in the docs

Thanks to all our open source contributors

Encore now has over 60 contributors and we're closing in on 6000 stars!🌟
(If you haven't yet—why not star the project!)

We continue to be overwhelmed by your suggestions, bug reports, feedback, and pull requests.

New Contributors ❤️

Tell us what you think

We love it when you share your Encore experiences with us and the world on Twitter, and when you ask questions on Discord.

Other improvements

Full Changelog: v1.39.0...v1.40.0

v1.39: Encore.ts Bonanza!

27 Jun 08:06
b1e2e5b
Compare
Choose a tag to compare

We're excited to announce a new release of Encore.ts, which includes a ton of improvements and bug-fixes. As always, get it with encore version update.

Encore.ts: Explicit service roots (#1274)

One thing a lot of newcomers to Encore struggled with was the implicit way that you defined services: by having a folder that contains at least one API endpoint. It led to a lot of confusion around how to define services and how to best organize the code.

To fix this, we've introduced a new, much more explicit way of defining services. Starting with this release you can define a service by creating a file named encore.service.ts containing:

import { Service } from "encore.dev/service";

export default new Service("service-name", {});

Encore will consider the folder it lives in as the "service root", and everything within it (including subdirectories) is part of the service.

The second argument ({} in the example above) is an optional config object. Currently there are no additional options for a service, but we'll be adding some in the near future.

The old approach will continue to work. We recommend all Encore.ts users start using this going forward, and we'll provide a way to opt-in to enforcing this for those who want it. We're updating all examples to use this approach.

For Encore.go users: This functionality is also coming to Encore.go! It's a slightly larger undertaking due to some design differences between Encore.ts and Encore.go.

Encore.ts: Logs in traces (#1248)

Log messages written using Encore's structured logging package (encore.dev/log) are now automatically included in traces.

This package also automatically adds useful metadata to each log line (including things like which request is being processed, the service and endpoint being called, trace and span information, and more).

We recommend using encore.dev/log for all your logging needs!

Encore.ts: Body size limits (#1268)

You can now configure the maximum request body size for any Encore API endpoint:

import { api } from "encore.dev/api"

// Limit the body to 10 MiB.
export const myEndpoint = api({ bodyLimit: 10 * 1024 * 1024 },
  async (req: Params) => Promise<void> {
    // ...
  }
);

You can also set bodyLimit: null to remove the limit altogether. If you leave it unset, it defaults to 2MiB.

Encore.ts: Support for enum types (#1254)

You can now use TypeScript enums in your API schemas! That means this is possible:

enum PostType {
  BlogPost = "BLOG_POST",
  Comment = "COMMENT"
}

interface PublishParams {
  type: PostType,
  // ... more fields
}

export const publish = api(
  { expose: true, method: "POST", path: "/publish" },
  async (params: PublishParams): Promise<Post> => {
    // ...
  }
);

Encore interprets this like type: "BLOG_POST" | "COMMENT".

Encore.ts: Number literal math expressions (#1271)

As seen in the body size example snippet above, you can now use common mathematical operators like +-*/% in configuration that Encore parses with static analysis. This makes certain numbers much easier to express (like 10MiB above).

Encore.ts: Literal null support (#1236)

You can now use null in Encore API schemas (including in unions: foo: string | null).

Union types in OpenAPI generation (#1257)

Encore's OpenAPI generator now correctly handles TypeScript union types.

Bugfixes & Other Improvements

  • TS: Pub/Sub subscriptions are now always initialized even if not otherwise imported (#1276)
  • TS: Randomize the port for the Rust runtime's SQL database proxy (#1266)
  • TS: URL-encode API call parameters (#1262)
  • TS: Support more complex types in path parameters (#1261)
  • TS: Parse JSDoc comments correctly (#1258)
  • TS: Improved runtime logging (#1249)
  • TS: Fix stripping of path params from request payload (#1252)
  • TS: Support gzipped env data (#1255)
  • TS: Handle unary plus and minus (#1256)
  • ... And lots more!

Thanks to all contributors

🙏 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.

Advanced TypeScript types

31 May 13:47
Compare
Choose a tag to compare

We're excited to announce Encore v1.38, which brings a huge set of improvements to Encore's static analysis of TypeScript type information! As always, update with encore version update.

Advanced TypeScript types

You can now define use advanced TypeScript features like generic types, union types, conditional types, mapped types, literal types, and much more, in your API endpoints. This also include utility types you've come to love, like Record<K, V>, Partial<T>, Required<T>, Pick<T, K>, Omit<T, K>, and more.

We're going to keep expanding on Encore's TypeScript type system support over the coming releases, so let us know on Discord if there's additional type system functionality you'd like to see.

Launch Week Release Roundup

13 May 12:56
Compare
Choose a tag to compare

Launch Week

Last week was Encore's first ever Launch Week, 5 days of big releases and community events.

It was pretty hectic, with plenty of cool new features. Here's everything that was launched.
You can also find blogs, videos, and livestream recording for all the launches on the Launch Week website.

Day 1: Encore for TypeScript

Encore now supports TypeScript and it's generally available! The new Open Source Backend SDK provides a declarative way of building services, APIs, and using cloud primitives like databases, Pub/Sub, cron jobs, and more.

Encore for TypeScript is powered by our new Rust-based runtime, integrated with Node.js for 100% compatability the Node ecosystem.
It provides some major upgrades compared to standard Node.js/Express:

  • 7x faster throughput (req/s)
  • 85% reduced response latency
  • 0 NPM dependencies
  • End-to-end type-safety even at runtime

📚 See the launch announcement on the blog
🎥 Watch the launch video on YouTube

Day 2: Encore is fully Open Source + New lower price plan

Encore's Open Source tools and SDKs can now be used fully independent of Encore, and requires no Encore account! This means you can more easily build and self-host Encore applications with no dependency on Encore the organization.

We've also made these improvements:

  • Simplified configuration for self-hosting Encore apps and improved documentation.
  • The Free plan now gets unlimited seats.
  • New Pro plan at a much lower price, just $39 per member / month. (See more info on pricing)

📚 See the launch announcement on the blog

Day 3: Serverless Postgres & Database branching powered by Neon

Encore now supports using Neon as a database provider for all your environments, including those in your cloud on AWS and GCP. Neon's serverless postgres scales to zero, which makes it a great choice for early stage startups who may want to optimize their cloud costs.

When you use Neon for your production or testing database, you can configure Encore's built-in ephemeral Preview Environments to branch off this database, automatically seeding your Preview Environment with real-world data to simplify testing.

📚 See the launch announcement on the blog
🎥 Watch the launch video on YouTube

Day 4: Elevate with Encore & Ardan Labs

Ardan Labs is now Encore's official Go training partner, and to celebrate we're launching a program designed to help you enhance your skills and increase your visibility within the developer community.

You get discounts on Go training from the experts at Ardan Labs, and Encore provides coaching and financial support to help you speak at tech conferences.

📚 See the launch announcement on the blog
🎥 Watch the launch video on YouTube

Day 5: AI API Creator

For the final day of Launch Week, we introduced Encore's first AI powered feature: AI API Creator, helping you speed up your development by turning prompts into production-ready code!

Integrated into Encore's local development dashboard, the new API Creator helps you quickly design and create new services and APIs, then add them directly to your app. All without leaving the dashboard.

Unlike most other AI tools, Encore's AI API Creator has a purpose-built workflow that gives you much more control over the API design and allows for simple and fast manual edits, without requiring endless prompting.

📚 See the launch announcement on the blog
🎥 Watch the launch video on YouTube

Launch Week will return

That's it for this time, we hope you enjoyed the show and will find these new launches helpful for your development! If you have any questions, feedback, or just want to hang out with other developers, join our friendly community on Discord.🖤

— André & the Encore team

Detailed changelog

Full Changelog: v1.35.3...v1.37.0

TypeScript Metadata API

12 Apr 14:58
Compare
Choose a tag to compare

We're excited to announce Encore v1.35, with several improvements to Encore for TypeScript!

Discord

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:

  • This will give us several key features that we believe will make the community more engaging and helpful for all members:
  • Unlimited message history, so we never lose valuable chats.
  • Improved Q&A using built-in forums, making it faster and easier to find answers and share knowledge.
  • Dedicated boards for submitting and voting on suggestions — we love hearing your ideas and want to get better at tracking them.
  • The ability to schedule and host live streamed community events.

Hope to see you there!

TypeScript Metadata API

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;
}

Client Generation improvements

The encore gen client command now accepts --excluded-services=foo,bar to exclude specific services from the generated client.

Various TypeScript Improvements

We're also making rapid improvements to all aspects of Encore for TypeScript:

  • Pub/Sub: Added support for AWS Pub/Sub (SQS + SNS)
  • Pub/Sub: Implemented support for maxConcurrency across local development, GCP, and AWS
  • API: Added trailing slash redirect handling

Full Changelog: v1.34.7...v1.35.3