Skip to content

release 1.3: Herta #1141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 117 commits into from
May 5, 2025
Merged

release 1.3: Herta #1141

merged 117 commits into from
May 5, 2025

Conversation

SaltyAom
Copy link
Member

Based on #1098

Release name:

Codename: Herta (Honkai Star Rail)

Herta

@SaltyAom SaltyAom mentioned this pull request Mar 26, 2025
@SaltyAom SaltyAom self-assigned this Mar 26, 2025
@SaltyAom SaltyAom added the priority This feature is one of a priority work label Mar 26, 2025
@zoriya
Copy link
Contributor

zoriya commented May 4, 2025

t.Transform types aren't decoded anymore (they are at runtime but the type hints aren't). Example:

import Elysia, { t } from "elysia";

function addTwo(num: number) {
	return num + 2;
}

const app = new Elysia()
	.get("", async ({ query: { foo } }) => addTwo(foo), {
		query: t.Object({
			foo: t
				.Transform(t.String())
				.Decode((x) => 12)
				.Encode((x) => x.toString()),
		}),
	})
	.listen(1234);

This code will work without issue at runtime but will fail tsc due to:

index.ts:8:48 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

@SaltyAom
Copy link
Member Author

SaltyAom commented May 4, 2025

t.Transform types aren't decoded anymore (they are at runtime but the type hints aren't). Example:

import Elysia, { t } from "elysia";

function addTwo(num: number) {
	return num + 2;
}

const app = new Elysia()
	.get("", async ({ query: { foo } }) => addTwo(foo), {
		query: t.Object({
			foo: t
				.Transform(t.String())
				.Decode((x) => 12)
				.Encode((x) => x.toString()),
		}),
	})
	.listen(1234);

This code will work without issue at runtime but will fail tsc due to:

index.ts:8:48 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

@zoriya Should have been fixed on 1.3.0-exp.75

@SaltyAom SaltyAom merged commit 524db40 into main May 5, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority This feature is one of a priority work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants