-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: store types and some other internal types that got lost in the conversion #8658
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -26,7 +26,7 @@ export function readable(value, start) { | |||
* Create a `Writable` store that allows both updating and reading by subscription. | |||
* @template T | |||
* @param {T} value initial value |
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.
I think this is also optional in master
if I understand that's what the =
syntax means. Do we want to do the same here?
svelte/src/runtime/store/index.ts
Line 68 in 3bc791b
* @param {*=}value initial value |
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.
both ways work, {string=} foo
is google closure syntax while {string} [foo]
is from jsdoc itself. ts knows both https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#param-and-returns I think being consistent is important, using the [] syntax is a bit more to type but closer to jsdoc and allows telling about a default values.
It looks like there are others that got lost in the migration. E.g.
I found some with |
some others:
https://github.com/sveltejs/svelte/blob/version-4/packages/svelte/src/compiler/utils/link.js
also noticed that
it also seems some types got dropped like in
and it looks like the type may have really changed here:
|
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. though I'm scared of what else we might be missing
i'm also scared that our type checking didn't catch any of these errors. Is that because none of these are actually used in an optional manner or because we're just way too loose with our type checking settings?
HEADS UP: BIG RESTRUCTURING UNDERWAY
The Svelte repo is currently in the process of heavy restructuring for Svelte 4. After that, work on Svelte 5 will likely change a lot on the compiler aswell. For that reason, please don't open PRs that are large in scope, touch more than a couple of files etc. In other words, bug fixes are fine, but feature PRs will likely not be merged.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests
npm test
and lint the project withnpm run lint