Skip to content

fix(client): Don't rely on instanceof to detect TypedSQL instances#25453

Merged
SevInf merged 1 commit intomainfrom
fix/no-instanceof-typed-sql
Oct 18, 2024
Merged

fix(client): Don't rely on instanceof to detect TypedSQL instances#25453
SevInf merged 1 commit intomainfrom
fix/no-instanceof-typed-sql

Conversation

@SevInf
Copy link
Copy Markdown
Contributor

@SevInf SevInf commented Oct 18, 2024

HMR can mess up instanceof checks so that older typed sql instances
won't be detected by newer, hot reloaded runtime.
Fixing this by adding "magic" property to the TypedSQL class and
checking for that instead, so it works across realms/different runtime
instances.

Fix #25331

HMR can mess up `instanceof` checks so that older typed sql instances
won't be detected by newer, hot reloaded runtime.
Fixing this by adding "magic" property to the `TypedSQL` class and
checking for that instead, so it works across realms/different runtime
instances.

Fix #25331
@SevInf SevInf added this to the 5.21.0 milestone Oct 18, 2024
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
packages/client/runtime/library.js 186.4 KB (+0.06% 🔺)
packages/client/runtime/library.d.ts 81 B (0%)
packages/client/runtime/binary.js 607.44 KB (+0.02% 🔺)
packages/client/runtime/binary.d.ts 26 B (0%)
packages/client/runtime/edge.js 162.17 KB (+0.06% 🔺)
packages/client/runtime/edge-esm.js 161.97 KB (+0.06% 🔺)
packages/client/runtime/wasm.js 120.97 KB (+0.08% 🔺)
packages/client/runtime/index-browser.js 33.9 KB (0%)
packages/client/runtime/index-browser.d.ts 89 B (0%)
packages/cli/build/index.js 2.13 MB (0%)
packages/client/prisma-client-0.0.0.tgz 2.91 MB (+0.01% 🔺)
packages/cli/prisma-0.0.0.tgz 3.71 MB (+0.01% 🔺)
packages/bundle-size/da-workers-libsql/output.tgz 868 KB (+0.01% 🔺)
packages/bundle-size/da-workers-neon/output.tgz 947.55 KB (+0.01% 🔺)
packages/bundle-size/da-workers-pg/output.tgz 965.98 KB (+0.01% 🔺)
packages/bundle-size/da-workers-pg-worker/output.tgz 921.69 KB (+0.01% 🔺)
packages/bundle-size/da-workers-planetscale/output.tgz 884.42 KB (+0.01% 🔺)
packages/bundle-size/da-workers-d1/output.tgz 840.37 KB (+0.01% 🔺)

@SevInf SevInf merged commit 886746c into main Oct 18, 2024
@SevInf SevInf deleted the fix/no-instanceof-typed-sql branch October 18, 2024 09:56
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.

Argument query is missing error when using TypedSQL preview feature

2 participants