-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Generate .d.ts bundle from source #9992
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
Conversation
|
|
One compromise — had to expose That said, I realised just now that we're currently messing up by referencing these modules anyway, and need to come up with a different solution. Both of them indirectly reference the app version, which defeats the goal of maintaining hash stability between deployments. I therefore think we need to rethink how that's implemented, but that's out of scope of this PR so I'm going to punt on it for now. |
elliott-with-the-longest-name-on-github
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l.g.t.m.
a o e o
u d n m
d l d e
e y i n
d n t
g a
r
i
l
y
| // JSdoc doesn't seem to like @type with function overloads | ||
| /** | ||
| * @type {import('@sveltejs/kit').error} | ||
| * @overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL -- I was searching for this a while ago and couldn't find it!
Co-authored-by: Ben McCann <[email protected]>
benmccann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. for those who haven't been following along, the motivation for this PR is explained in #9883 (comment)
I nerd-sniped myself in #9895 (comment) — I've created a small library, dts-buddy (couldn't think of a better name), for generating
.d.tsbundles.It's currently missing two important features:
Also, virtual modules like
__sveltekit/environmentare currently a TODO. We also need toOnce those things are fixed, I think this gives us the best of all possible worlds — everything is derived from source (no more duplicating function definitions inside the hand-authored
.d.tsfiles), and 'go to definition' will finally work properly. We also get to delete a bunch of stuff.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.