Releases: encoredev/encore
v1.41.9 - Improved Encore.ts error messages and Encore.go middleware
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
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.
Other improvements
- Corrected typo in url shortner ts example from tutorials by @gammaSpeck in #1454
- cli: support overriding dev dash listen addr by @eandre in #1468
- Add docs about database ORM by @simon-johansson in #1449
- Add validation TS docs by @simon-johansson in #1457
- Add flag to exclude private endpoints from OpenAPI spec by @nitsanshai in #1452
- bufgen: Update file to use v2 by @echarrod in #1296
Thanks to our new contributors ❤️
- @gammaSpeck made their first contribution in #1454
- @echarrod made their first contribution in #1296
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
What's Changed
- Fix docs broken links by @marcuskohlberg in #1410
- clientgen: handle optional auth params by @eandre in #1411
- Add YouTube video to express docs by @simon-johansson in #1413
- Corrected typos in document about TS Benefits by @luisnquin in #1415
- cli/daemon: resolve local apps for client gen by @eandre in #1416
- Faq by @marcuskohlberg in #1418
- tsparser: fix symlink detection on Windows by @eandre in #1422
- Only include non-private endpoints in OpenAPI spec output by @nitsanshai in #1419
- Update service definition docs by @simon-johansson in #1423
- tsparser: support string literal members by @eandre in #1424
- Update uptime.md by @stefanop21 in #1390
- cli: Add alpha support for triggering deploys from cli by @ekerfelt in #1417
- supervisor: Add option to launch encore services with supervisor by @ekerfelt in #1396
- Add TS GraphQL tutorial by @simon-johansson in #1425
- daemon: cap proc wait time to 500ms by @eandre in #1428
- Revert "Only include non-private endpoints in OpenAPI spec output" by @eandre in #1427
- Remove the code that has no practical effect by @cuishuang in #1420
- docs: fix markdown syntax by @eandre in #1429
- Allow app init without account by @ekerfelt in #1432
- encorebuild: only use zig when cross compiling or on release by @fredr in #1433
- runtimes/js: propagate APIError across API calls by @eandre in #1434
- Unhide alpha deploy command by @ekerfelt in #1435
- Corrected typos in booking system example from tutorials by @luisnquin in #1442
- Corrected typos in TS documents by @luisnquin in #1441
- Corrected typos in quickstart document by @luisnquin in #1440
- Corrected typos in go documents by @luisnquin in #1439
- Corrected typos in develop documents by @luisnquin in #1438
- Corrected typo in document about deployments by @luisnquin in #1437
- Fix broken links by @marcuskohlberg in #1443
- Add GraphQL TS docs by @simon-johansson in #1430
- Err on http err when downloading ssl certs by @ekerfelt in #1446
- Fetch docker image root certs from cached encore storage by @ekerfelt in #1447
- Add a "how to"-guide for template engine by @simon-johansson in #1444
- docs: Add troubleshooting for connecting GCP clouds by @ekerfelt in #1448
- Support filtering by tags in client generation by @nitsanshai in #1431
- tsparser: improve errors around tsconfig parsing by @fredr in #1451
Thanks to our first time contributors ❤️
- @luisnquin made their first contribution in #1415
- @nitsanshai made their first contribution in #1419
- @stefanop21 made their first contribution in #1390
- @cuishuang made their first contribution in #1420
Full Changelog: v1.41.4...v1.41.7
v1.41.4 - Minor improvements & bugfixes
What's Changed
- runtimes/core: startup psql proxy early to allow initialization by @fredr in #1407
- Tweaks to the streaming docs by @simon-johansson in #1406
- tsparser: ignore tests by @eandre in #1408
Full Changelog: v1.41.3...v1.41.4
v1.41.3 - Minor improvements & bugfixes
What's Changed
- Add a rust-based supervisor by @ekerfelt in #1385
- runtimes/core: add string mapping for uuid fields by @fredr in #1393
- Add some related docs links by @marcuskohlberg in #1391
- Update app-structure.md by @marcuskohlberg in #1397
- parser: keep case for query paramters in typescript by @fredr in #1399
- Update Cargo.lock with supervisor deps by @fredr in #1400
- tsparser: fix relative paths for individual service codegen by @eandre in #1402
- tsparser: handle service names with dashes, name conflicts by @eandre in #1403
- tsparser: fall back to junction points on windows by @eandre in #1401
- runtimes/js: document
currentRequest()
by @eandre in #1404 - runtimes/js: flush headers on early close by @eandre in #1405
Full Changelog: v1.41.1...v1.41.3
v1.41.1 - Static assets support in Encore.ts (powered by Rust)
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
- Update rest-api.mdx by @marcuskohlberg in #1354
- clientgen: skip streaming endpoints in unsupported langs by @fredr in #1355
- Clean up the benefits/overview docs to be more to the point by @marcuskohlberg in #1358
- clientgen: properly close getAuthData when no auth by @fredr in #1361
- Corrected typo in index.mdx by @azharsamdani in #1360
- clientgen: more idiomatic empty return by @fredr in #1362
- runtimes/js: export raw request types by @eandre in #1363
- tsparser: set streaming field for test handlers by @eandre in #1364
- cli: refactor file watching logic by @eandre in #1357
- fix: increase timeout for api client generation by @melkstam in #1356
- Fixes to document structure in Express.js migration guide by @simon-johansson in #1365
- Encore.ts API docs refactoring by @marcuskohlberg in #1359
- Fix line breaks in api documentation by @marcuskohlberg in #1366
- runtimes/core: handle handshake request with only path params by @fredr in #1368
- runtimes/js: fix nodejs socket compatibility by @eandre in #1370
- chore: Update streaming API documentation by @trueshizus in #1367
- Additions to the streaming api docs by @simon-johansson in #1371
- Add how to guide about using NestJS with Encore by @simon-johansson in #1272
- runtimes/js: support Buffer in db queries by @eandre in #1372
- runtimes/js: don't destroy stream after done by @eandre in #1376
- Encore.Go Docs refactor by @marcuskohlberg in #1369
- change filename to fix broken link by @marcuskohlberg in #1379
- runtimes/js: add api.static for serving static files by @eandre in #1378
- Fix docs menu syntax, improve static asset parsing by @eandre in #1381
- cli: increase app creation timeout by @eandre in #1382
- Add file upload docs by @simon-johansson in #1380
- Fix metadata variable names by @simon-johansson in #1375
- Add links to GitHub for related examples by @simon-johansson in #1384
- Add related examples to more docs pages by @marcuskohlberg in #1386
Thanks to our New Contributors ❤️
- @azharsamdani made their first contribution in #1360
- @trueshizus made their first contribution in #1367
- @leofmarciano made their first contribution with this Supabase + Encore.ts example
Full Changelog: v1.40.0...v1.41.1
v1.40: Encore.ts Streaming APIs
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.
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 ❤️
- @agtabesh made their first contribution in #1301
- @omahs made their first contribution in #1313
- @nnsW3 made their first contribution in #1330
- @IDispose made their first contribution in #1302
- @tuckers-tech made their first contribution in #1351
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
- Add docs for TS logging by @ekerfelt in #1280
- Add support for debugging TS apps by @ekerfelt in #1281
- Add support for clearing traces from the local dashboard by @ekerfelt in #1282
- cli: Add lang selector in app init by @ekerfelt in #1284
- Use dlv for debugging if available by @ekerfelt in #1283
- docs: Add docs for setting cookies by @ekerfelt in #1285
- cli/cmd/encore: fix watch mode by @eandre in #1286
- fix: run cargo fmt by @fredr in #1287
- cli: fix brew update by @eandre in #1288
- Update go hello world example in readme by @fredr in #1289
- Refactor gateway in rust runtime by @fredr in #1275
- runtimes/core: Remove temporary bind of gateway listener by @fredr in #1291
- runtimes/core: handle lack of services and gateways by @eandre in #1292
- runtimes/core: handle route conflicts in gateway by @eandre in #1293
- runtime/core: handle varchar in psql by @fredr in #1299
- fix: fix typo in app-structure.md by @agtabesh in #1301
- tsparser: go tag pairs should be separated by colon by @fredr in #1305
- clientgen/typescript: Add parentheses when lists element type is union by @fredr in #1304
- Update README.md by @marcuskohlberg in #1310
- Log raw log line when json formatting fails by @fredr in #1311
- Update pingora with windows support by @fredr in #1303
- Cleanup unused cargo dependencies by @fredr in #1300
- Use pingoras error helpers by @fredr in #1312
- docs: fix typos by @omahs in #1313
- clientgen: Add test from ts app by @fredr in #1306
- runtimes/core: handle worker mode by @eandre in #1318
- Simplify codegen import paths by @fredr in #1319
- tsparser: add support for pnpm by @fredr in #1321
- tsparser: Search for package manager in workspace by @fredr in #1322
- Update README.md by @marcuskohlberg in #1323
- Update README.md by @marcuskohlberg in #1324
- use framework wording in docs by @marcuskohlberg in #1325
- runtimes/go: bump pubsub library client by @eandre in #1328
- runtimes/go: add adaptive gcp pubsub experiment by @eandre in #1329
- runtimes/js: bump braces by @fredr in #1331
- docs: fix spelling issues by @nnsW3 in #1330
- runtimes/js: don't set worker mode in tests by @fredr in #1332
- Update readme and related docs by @marcuskohlberg in #1335
- Update self-host.md by @IDispose in #1302
- doc: add missing commas in runtime config example by @fredr in #1336
- Update README.md by @marcuskohlberg in #1337
- runtimes/ts: don't throw when logging fails by @fredr in #1338
- focus database troubleshooting docs by @marcuskohlberg in #1339
- eject: make sure the go binary is executable on windows by @fredr in #1341
- Bump go-containerregistry by @fredr in #1342
- daemon: set a default log level in tests by @fredr in #1344
- gcp: reduce max pubsub streams to 90*conns by @eandre in #1345
- Cap concurrent local DB migratons to 50 to avoid hitting PSQL max conns by @ekerfelt in #1334
- tsparser: error when auth handler have unsupported fields by @fredr in #1346
- runtimes/core: respect max retries for nsq by @eandre in #1347
- TS: Add support for streaming apis by @fredr in #1315
- fix panic when running e2e-tests by @fredr in #1350
- TS Database Docs: Fix example database query for single row by @tuckers-tech in #1351
- Add express comparison docs by @simon-johansson in #1349
- Remove unused lockfiles by @fredr in #1297
- Add a link to the feature comparison section by @simon-johansson in #1352
- docs/ts: Add docs for new streaming apis by @fredr in #1348
Full Changelog: v1.39.0...v1.40.0
v1.39: Encore.ts Bonanza!
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
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
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
- runtimes/core: support PKCS#1 certs by @eandre in #1147
- fix broken links by @marcuskohlberg in #1149
- Update quick-start.mdx by @marcuskohlberg in #1150
- Update quick-start images by @marcuskohlberg in #1151
- Fix README.md typo by @marcuskohlberg in #1152
- runtimes/js: Add raw endpoint handling by @eandre in #1148
- tsparser: fix codegen for raw endpoints by @eandre in #1153
- update pricing docs by @marcuskohlberg in #1154
- Add language field to metadata by @eandre in #1155
- runtimes/core: update tokio-postgres dependency by @eandre in #1156
- runtimes/core: update tokio-postgres by @eandre in #1157
- Improve TLS handling in new runtime config by @eandre in #1158
- cli: improve app create experience by @eandre in #1159
- cli: graduate secrets override to non-experiment by @eandre in #1160
- Update uptime.md by @marcuskohlberg in #1162
- Minor TS fixes by @eandre in #1163
- Various TypeScript runtime fixes by @eandre in #1164
- runtimes/core: ignore empty fields for auth data by @eandre in #1165
- minor ts fixes by @eandre in #1166
- tsparser: handle missing encore.gen directory by @eandre in #1167
- Add test to rest api tutorial by @simon-johansson in #1161
- tsparser: fix test codegen by @eandre in #1169
- runtimes/core: fix tls cert handling by @eandre in #1170
- runtimes/core: fix sqs message parsing by @eandre in #1172
- runtimes/core: fix aws pubsub message visibility by @eandre in #1173
- runtimes/core: fix raw body encoding by @eandre in #1174
- Add uptime and slack-bot TS tutorials by @simon-johansson in #1171
- appfile: support configuring docker working dir by @eandre in #1177
- Tutorial fixes to slack-bot and uptime by @simon-johansson in #1176
- ai: Improve handling and formatting of errors returned from platform by @ekerfelt in #1168
- runtimes/js: various performance improvements by @eandre in #1183
- sqldb: support podman by @sudomateo in #1179
- runtimes/js: fix jemalloc library usage by @eandre in #1185
- neon: Add Neon documentation by @ekerfelt in #1182
- runtimes/js: fix jemalloc config by @eandre in #1186
- runtimes/js: remove jemalloc by @eandre in #1187
- Update curl body on uptime ts tutorial by @simon-johansson in #1188
- go: Bump go.mod go version to match encore-go. by @ekerfelt in #1190
- update docs by @marcuskohlberg in #1189
- update docs and readme by @marcuskohlberg in #1193
- Add TS docs for Vercel hosting by @simon-johansson in #1192
- tsparser: add support for
SQLDatabase.named
by @eandre in #1194 - runtimes/js: support noop databases by @eandre in #1195
- docs: update cron job docs to reflect encore cloud free tier limits by @anish749 in #1197
- docs: Add section about Neon PR environments by @ekerfelt in #1196
- docs: add self-hosting docs by @eandre in #1199
- docs: Update uptime tutorial by @ekerfelt in #1200
- runtimes/go: add et.NewTestDatabase by @eandre in #1184
- runtimes/go: fix publicapigen output by @eandre in #1202
Full Changelog: v1.35.3...v1.37.0
TypeScript Metadata API
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