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

fix(client): types oom and inferred length errors #20161

Merged
merged 22 commits into from Jul 26, 2023

Conversation

millsp
Copy link
Member

@millsp millsp commented Jul 10, 2023

closes #16536
closes #19999

(maybe related #20308)

Internal Slack

@millsp millsp added this to the 5.1.0 milestone Jul 10, 2023
@millsp millsp force-pushed the integration/fix/client/oom-default-selection branch from 693e410 to 37305a1 Compare July 11, 2023 02:21
@millsp
Copy link
Member Author

millsp commented Jul 11, 2023

Will add tests once I got the greenlight/feedback from the users.

@prisma prisma deleted a comment from codspeed-hq bot Jul 21, 2023
@millsp millsp marked this pull request as ready for review July 21, 2023 20:52
@millsp millsp requested a review from a team as a code owner July 21, 2023 20:52
@millsp millsp requested review from SevInf and Druue and removed request for a team July 21, 2023 20:52
@millsp
Copy link
Member Author

millsp commented Jul 21, 2023

Needs #20285, for now code just added here too.

@millsp millsp changed the title fix(client): types oom default selection fix(client): types oom and inferred length errors Jul 22, 2023
@millsp millsp requested review from Jolg42 and removed request for Druue July 22, 2023 02:49
@prisma prisma deleted a comment from codspeed-hq bot Jul 22, 2023
@Jolg42 Jolg42 requested a review from aqrln July 24, 2023 14:39
@millsp millsp merged commit ec07b49 into main Jul 26, 2023
68 checks passed
@millsp millsp deleted the integration/fix/client/oom-default-selection branch July 26, 2023 20:08
SevInf added a commit that referenced this pull request Sep 18, 2023
In #20161, in order to solve type declaration/OOM/performance issues,
we added forced exports for every type within the runime.

However, our type bundler renames certain types if the naming conflicts.
For example, if there are 2 `Result` types, one of them will be renamed
to `Result_2`.

Making renamed type public gives `tsc` green light for dependenig on it
when creating declaration for third-party library. This is wrong,
because rename is not guaranteed to be stable. In fact, we have the
problem with `accelerate` extension on a different branch: latest
Accelerate depends on `Result_2`, but in a branch corresponding type got
renamed to `Result_3`.

Internal discussion: https://prisma-company.slack.com/archives/C04TW4A2H8C/p1694778678856899

In this PR we revert to manual re-exports and ensure every type from
`core/types` gets re-exported without rename. Tests, fixed in #20161 are still green,
but it also ensures that only types we want will leak to third party
project.

Couple of public types with conflicting names got renamed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants