Skip to content
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

Update rescript-schema up to V8 #1271

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Conversation

DZakh
Copy link
Contributor

@DZakh DZakh commented Jul 15, 2024

No description provided.

@@ -55,16 +55,15 @@
"jointz": "7.0.4",
"json-decoder": "1.4.1",
"mol_data_all": "1.1.1123",
"@mondrian-framework/model": "2.0.43",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was duplicated

Comment on lines 5 to 7
// To bypass the "Assertions require every name in the call target to be declared with an explicit type annotation.ts(2775)"
// when using assert
type Data = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please clarify this requirement?

Re-declaring types go against the ideals of this test repository.

Copy link
Contributor Author

@DZakh DZakh Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a TS thing. I've managed to work around it by adding ! after assert. The effect-schema lib uses the same approach, so probably it's fine. Not super experienced with TS hacks :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI: the issue seems to be that you cannot use a generic assert arg is T as a method without explicit type annotations: microsoft/TypeScript#34596

Your hack with the exclamation mark disables the type-assertion, data after the assertion is still unknown.

Other libraries either do not use an asserts type method at all or they are using a asserts function.

@moltar moltar requested a review from hoeck July 15, 2024 15:16
@DZakh
Copy link
Contributor Author

DZakh commented Jul 18, 2024

@hoeck I'm interested in seeing the performance changes for v8. Could you merge the PR, please? 👀

@hoeck
Copy link
Collaborator

hoeck commented Jul 19, 2024

@DZakh thanks for pinging me, the mail from github somehow slipped off my radar 😅 sorry

@hoeck hoeck merged commit 4feb0ad into moltar:master Jul 19, 2024
6 checks passed
@DZakh
Copy link
Contributor Author

DZakh commented Jul 19, 2024

@hoeck
Copy link
Collaborator

hoeck commented Jul 20, 2024

Btw, node v22 runner did break https://github.com/moltar/typescript-runtime-type-benchmarks/actions/runs/10008222868/job/27664468375

Yeah noticed this too, the npm install prior to running the linter failed with an NPM internal error. Works on my machine though so let's just run it again and hope for the best.

@hoeck
Copy link
Collaborator

hoeck commented Jul 20, 2024

Ok, this seems to be a bug in the latest NPM version used by nodejs 22: npm/cli#7672

If I am reading this right, waiting for actions/node-versions#182 should give us a fixed node/npm version the next time we run the action (maybe delete the action cache before, don't know).

@hoeck
Copy link
Collaborator

hoeck commented Jul 23, 2024

Now it went through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants