Repository navigation
refactor using globals and fix misc type errors - #1727
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). next-prisma-starter – ./examples/next-prisma-starter🔍 Inspect: https://vercel.com/trpc/next-prisma-starter/k5nCDEXqFa31sCVmRxDPidXXtsk5 www – ./www🔍 Inspect: https://vercel.com/trpc/www/2Y3kxLaSDTL989u63PdDfxAepuX3 |
| const error = new TRPCError({ | ||
| code: 'PARSE_ERROR', | ||
| cause, | ||
| cause: getCauseFromUnknown(cause), |
| "include": ["src", "test"], | ||
| "compilerOptions": { | ||
| "lib": ["ES2020"], | ||
| "lib": ["ES2020", "DOM"], |
There was a problem hiding this comment.
For the tests and the window object in assertNotBrowser:
trpc/packages/server/src/assertNotBrowser.ts
Lines 5 to 6 in b838ef2
I can suppress the errors in assertNotBrowser and create a separate tsconfig for the tests if you like that better
There was a problem hiding this comment.
Ah, didn't know window was a global in deno. All good then.
Is there a way to do a "deno build" as part of ci to ensure it all works?
There was a problem hiding this comment.
Considering it relies on a CDN to work with Deno, probably not, unless we do a publish. We could do a separate build for Deno but that would definitely complicate things (although I'm open to looking into it if you want to go in that direction).
There was a problem hiding this comment.
Could we use github as a cdn and have a dynamic deno script that is created and run in CI?
Not asking you to do this, just spitballing if it would work
E.g. create a file creates:
import trpc from `https://raw.githubusercontent.com/trpc/trpc/{{CURRENT_COMMIT_HASH}}/packages/server/src/index.ts`
// [..] start deno server with a little routerThen it could ping itself or something.
There was a problem hiding this comment.
There was a problem hiding this comment.
There would still be other issues, Deno can work with relative file imports anyway. One thing is that in Deno, all imports must have file extensions (.ts). TypeScript doesn't support this though (Deno has forked TS to allow it), so it will break for us if we try to add extensions.
|
Adding a cloudflare workers example needs #1596 because subscriptions currently use the node builtin |
|
This pull request has been locked because it had no new activity for 30 days. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
closes #1597
closes #1588
Refactor globals:
URLandURLSearchParamsglobal instead of importing fromurlType errors:
causeproperty to conform to https://github.com/tc39/proposal-error-causeThis could have been two separate PRs but both are needed for Deno support.
Need to add examples.