https://github.com/sveltejs/svelte/pull/8569 Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} sveltejs / svelte Public * * Notifications * Fork 3.3k * Star 67.5k * Code * Issues 755 * Pull requests 53 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights 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. Pick a username [ ] Email Address [ ] Password [ ] [ ] Sign up for GitHub 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 Jump to bottom TS to JSDoc Conversion #8569 Open tcc-sejohnson wants to merge 131 commits into sveltejs:version-4 base: version-4 Choose a base branch [ ] Branches Tags Could not load branches Branch not found: {{ refName }} {{ refName }} default Could not load tags Nothing to show {{ refName }} default Are you sure you want to change the base? Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated. Change base from tcc-sejohnson:ts-to-jsdoc Open TS to JSDoc Conversion #8569 tcc-sejohnson wants to merge 131 commits into sveltejs:version-4 from tcc-sejohnson:ts-to-jsdoc +2,115 -1,561 Conversation 14 Commits 131 Checks 11 Files changed 45 Conversation This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters tcc-sejohnson Copy link @tcc-sejohnson tcc-sejohnson commented May 9, 2023 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 * [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https:// github.com/sveltejs/rfcs * [ ] Prefix your PR title with feat:, fix:, chore:, or docs:. * [ ] This message body should clearly illustrate what problems it solves. * [ ] Ideally, include a test that fails without this PR but passes with it. Tests * [ ] Run the tests with npm test and lint the project with npm run lint Sorry, something went wrong. 28 jaydenseric, Kwameowusu, Zeko369, skayo, PuruVJ, gyurielf, maxmmyron, faisalburhanudin, alexiglesias93, shanehh, and 18 more reacted with thumbs up emoji 37 sunneydev, asplunds, bcakmakoglu, rahulfromearth, nip10, Vulfpeck, TheDevMinerTV, subframe7536, matzeeable, phytonmk, and 27 more reacted with thumbs down emoji 1 PuruVJ reacted with laugh emoji 2 PuruVJ and tiidadavena reacted with hooray emoji 4 nitroin, caxerx, hielfx, and felipemfp reacted with confused emoji [?] 6 Bellisario, PuruVJ, bielcapanema, cangomescisco, oskarrough, and 007lva reacted with heart emoji 4 mashaal, PuruVJ, 007lva, and JuniorTour reacted with rocket emoji 9 cyyynthia, xuyang2, lachlancollins, PuruVJ, yardenshoham, subframe7536, wan2land, SaphiraNgocThuy, and qazxcdswe123 reacted with eyes emoji All reactions * 28 reactions * 37 reactions * 1 reaction * 2 reactions * 4 reactions * [?] 6 reactions * 4 reactions * 9 reactions tcc-sejohnson added 30 commits May 8, 2023 21:24 @tcc-sejohnson feat: Convert src/runtime/internal/animations.ts to JavaScript 7d94c82 @tcc-sejohnson chore: Move ... ebcc50e src/runtime/internal/animations.ts to src/runtime/internal/animations.js @tcc-sejohnson chore: Manual cleanup 0af3f6c @tcc-sejohnson feat: Convert src/runtime/internal/await_block.ts to JavaScript c6344f0 @tcc-sejohnson chore: Move ... 5a93b97 src/runtime/internal/await_block.ts to src/runtime/internal/await_block.js @tcc-sejohnson Format src/runtime/internal/await_block.js d5761c8 @tcc-sejohnson Convert src/runtime/internal/Component.ts to JavaScript f1f68b8 @tcc-sejohnson Move ... 78da974 src/runtime/internal/Component.ts to src/runtime/internal/Component.js @tcc-sejohnson Lint and format src/runtime/internal/Component.js 2c59183 @tcc-sejohnson Manual cleanup of src/runtime/internal/Component.js c7fd1c6 @tcc-sejohnson Convert src/runtime/internal/dev.ts to JavaScript ea4e793 @tcc-sejohnson Move src/runtime/internal/dev.ts to src/runtime/internal/dev.js 4ee5f7a @tcc-sejohnson Lint and format src/runtime/internal/dev.js 6045cb0 @tcc-sejohnson Manual cleanup of src/runtime/internal/dev.js 4bea83c @tcc-sejohnson Convert src/runtime/internal/environment.ts to JavaScript 629bdbf @tcc-sejohnson Move src/runtime/internal/environment.ts to src/runtime/internal/ envi... ... b673e15 ...ronment.js @tcc-sejohnson Lint and format src/runtime/internal/environment.js 30c36a3 @tcc-sejohnson Manual cleanup of src/runtime/internal/environment.js 9ac958a @tcc-sejohnson Convert src/runtime/internal/globals.ts to JavaScript fe9a69c @tcc-sejohnson Move src/runtime/internal/globals.ts to src/runtime/internal/ globals.js 2a46f25 @tcc-sejohnson Lint and format src/runtime/internal/globals.js 78e8d84 @tcc-sejohnson Convert src/runtime/internal/keyed_each.ts to JavaScript 17c0c67 @tcc-sejohnson Move src/runtime/internal/keyed_each.ts to src/runtime/internal/ keyed... ... 4dbfda1 ..._each.js @tcc-sejohnson Lint and format src/runtime/internal/keyed_each.js 3d446c5 @tcc-sejohnson Manual cleanup of src/runtime/internal/keyed_each.js 7350a3f @tcc-sejohnson Convert src/runtime/internal/lifecycle.ts to JavaScript 3b10265 @tcc-sejohnson Move src/runtime/internal/lifecycle.ts to src/runtime/internal/ lifecy... ... 5e00379 ...cle.js @tcc-sejohnson Lint and format src/runtime/internal/lifecycle.js 2804d71 @tcc-sejohnson Manual cleanup of src/runtime/internal/lifecycle.js 048ae8f @tcc-sejohnson Convert src/runtime/internal/loop.ts to JavaScript 3ae44e6 87 hidden items Load more... @vercel Copy link vercel bot commented May 9, 2023 @tcc-sejohnson is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. All reactions Sorry, something went wrong. @tcc-sejohnson tcc-sejohnson changed the base branch from master to version-4 May 9, 2023 05:30 @vercel Copy link vercel bot commented May 9, 2023 * edited The latest updates on your projects. Learn more about Vercel for Git /[?] Name Status Preview Comments Updated (UTC) svelte-dev-2 Failed (Inspect) May 9, 2023 5:30am All reactions Sorry, something went wrong. @vercel vercel bot had a problem deploying to Preview May 9, 2023 05:30 Failure PuruVJ PuruVJ reviewed May 9, 2023 View reviewed changes src/runtime/internal/loop.js Show resolved Hide resolved tcc-sejohnson and others added 5 commits May 9, 2023 00:13 @tcc-sejohnson type cleanup 3d4e58e @dummdidumm Convert ./src/compiler/parse/acorn.ts to JavaScript f6fd5ad @dummdidumm Move ./src/compiler/parse/acorn.ts to ./src/compiler/parse/acorn.js a20978a @dummdidumm Lint and format ./src/compiler/parse/acorn.js c4a9f74 @dummdidumm .js file endings 0455c56 @dyc3 Copy link dyc3 commented May 9, 2023 Hey, just curious: why is this change being made? I was looking around for an issue or something for discussion around this but I couldn't find anything. 18 dieulot, suabahasa, sjwilczynski, vguleaev, rahulfromearth, Altair-Bueno, Vulfpeck, kz-gonzalo-curbelo, Posandu, maxsbelt, and 8 more reacted with thumbs up emoji All reactions * 18 reactions Sorry, something went wrong. @baseballyama Copy link Member baseballyama commented May 9, 2023 As a Svelte compiler developer, debugging without a build step greatly simplifies compiler development. Previously, debugging was complicated by the fact that we had to debug using the build step. In addition, using JSDoc does not affect compiler's development safety because the type is almost equivalent to TS. Of course, Svelte developers (not compiler developers) will still be provided type definition files as now, so there will be no change for Svelte developers in terms of typing. 12 Hunam6, PuruVJ, thedenoff, Posandu, IshanKBG, m4rch3n1ng, Schweinepriester, dyc3, dtinth, 007lva, and 2 more reacted with thumbs up emoji 4 phytonmk, patrickmichalina, nelson6e65, and dinckelman reacted with thumbs down emoji All reactions * 12 reactions * 4 reactions Sorry, something went wrong. dummdidumm added 8 commits May 9, 2023 15:29 @dummdidumm Convert ./src/runtime/internal/dom.ts to JavaScript 268addd @dummdidumm Move ./src/runtime/internal/dom.ts to ./src/runtime/internal/dom.js 8e03ef9 @dummdidumm Lint and format ./src/runtime/internal/dom.js 67bcdc6 @dummdidumm manual cleanup of dom.js 00912f2 @dummdidumm Convert ./src/runtime/internal/transitions.ts to JavaScript ab50e60 @dummdidumm Move ./src/runtime/internal/transitions.ts to ./src/runtime/internal/ ... ... 535e586 ...transitions.js @dummdidumm Lint and format ./src/runtime/internal/transitions.js 155a438 @dummdidumm manual cleanup of transitions.js 39199cf @phytonmk Copy link phytonmk commented May 9, 2023 If the problem is reducing tests execution time maybe it is much better to focus on picking a faster Typescript transpiler (like esbuild or swc) rather than switching codebase from one language to a two separated ones what can cause new troubles like code desynchronization and weak abstraction relations? 9 enpitsuLin, patrickmichalina, playitsafe, jbddc, heimskr, zihan-ch, f-prime, thomasskk, and MrMicky-FR reacted with thumbs up emoji All reactions * 9 reactions Sorry, something went wrong. @baseballyama Copy link Member baseballyama commented May 9, 2023 If the problem is reducing tests execution time No. often library developers use npm link to link userland applications and debug the library. If the program is built at debug time, it will be difficult to find the function we are looking for. Also, e.g. when using the debugging function of VSCode, , it is necessary to debug with a built program, which makes it difficult to know where we are and we need to go back to original program every time when we want to fix something. The main point at present is whether TS or JS + JSDoc is more comfortable to write. 3 dtinth, alexbrokethis, and 007lva reacted with thumbs up emoji 5 enpitsuLin, f-prime, jbddc, phytonmk, and bartlangelaan reacted with thumbs down emoji All reactions * 3 reactions * 5 reactions Sorry, something went wrong. @connor4312 Copy link connor4312 commented May 9, 2023 Happened to see this on Twitter during lunch. I maintain the VS Code JS debugger. when using the debugging function of VSCode, , it is necessary to debug with a built program, which makes it difficult to know where we are and we need to go back to original program every time when we want to fix something. It's an aside from the main PR, but I'm not entirely sure what you mean here. This should not exclude the ability to use alternative TS compilers--in fact, the js debugger itself is built with esbuild. The debugger should also handle runtime transpilers (like tsx) just fine. One snag you might hit with npm link is that by default we don't follow sourcemaps in node_modules for performance reasons, but this can be adjusted by setting resourceSourceMapLocations: null (overriding its default) in your launch.json. Anyhow, if you're running into places where the debugger doesn't seem to work, please feel free to open an issue. [?] 6 stuft2, bartlangelaan, enpitsuLin, pan93412, dtinth, and felipemfp reacted with heart emoji All reactions * [?] 6 reactions Sorry, something went wrong. @Niclassg Copy link Niclassg commented May 10, 2023 As someone who has no stake in Svelte nor actively uses it I would be very much interested in a blog post describing the difficulties of using TS and why JSDoc + JS is seen as a better alternative so I can broaden my knowledge and understanding. All reactions Sorry, something went wrong. @PuruVJ Copy link Collaborator PuruVJ commented May 10, 2023 As someone who has no stake in Svelte nor actively uses it I would be very much interested in a blog post describing the difficulties of using TS and why JSDoc + JS is seen as a better alternative so I can broaden my knowledge and understanding. I wrote this some 2 years ago, should be relevant even now https:// puruvj.dev/blog/ get-to-know-typescript--using-typescript-without-typescript 1 enpitsuLin reacted with thumbs down emoji All reactions * 1 reaction Sorry, something went wrong. @dtinth Copy link dtinth commented May 10, 2023 As someone who has no stake in Svelte nor actively uses it I would be very much interested in a blog post describing the difficulties of using TS and why JSDoc + JS is seen as a better alternative so I can broaden my knowledge and understanding. Here's some context: * Rich Harris' interview in Svelte Society's Dev Vlog (watch on YouTube) [1a402688-da3f-45cf-9283-dc2587e3c50a] * https://twitter.com/Rich_Harris/status/1350436286948122625 All reactions Sorry, something went wrong. @dummdidumm Copy link Member dummdidumm commented May 10, 2023 I'm locking this PR for now to not distract maintainers with this conversation which was had multiple times before. As a user of Svelte this has NO impact whatsoever on you, and rest assured that the Svelte code base keeps the same level of type safety with this change. All reactions Sorry, something went wrong. @sveltejs sveltejs locked as too heated and limited conversation to collaborators May 10, 2023 @dummdidumm fixes bc5ebb0 Rich-Harris Rich-Harris reviewed May 10, 2023 View reviewed changes src/runtime/store/index.js Show resolved Hide resolved Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in. Reviewers @Rich-Harris Rich-Harris Rich-Harris left review comments @PuruVJ PuruVJ PuruVJ left review comments Assignees No one assigned Labels None yet Projects None yet Milestone No milestone Development Successfully merging this pull request may close these issues. None yet 10 participants @tcc-sejohnson @dyc3 @baseballyama @phytonmk @connor4312 @Niclassg @PuruVJ @dtinth @dummdidumm @Rich-Harris Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.