Clarify main.ts vs main.js
See original GitHub issue(First, let me apologise for posting Issues rather than PRs - I’m on an iPad reading your wonderful docs, and am not in a place where I can learn the file format to contribute text and the required style - but I wanted to capture fleeting-but-hopefully-useful thoughts as I had them)
Background
As I understand it, .ts files get compiled to .js files…
Ah yes, you mention this in “Create your first plugin” - using npm run dev
Several things are not totally clear to me, or occur to me…:
- whether that command needs to be run every time the .ts is edited, or whether it is automatic
- Whether all novices will understand the need to edit the .ts not the .js (especially as the linked video at the top of that page shows someone manually downloading and edited the .js file.)
- I note that the hot-reload plugin monitors the .js not the .ts
Thoughts
I wonder whether it’s worth this page - https://marcus.se.net/obsidian-plugin-docs/getting-started/development-workflow - having some explanation that it’s the .ts you edit, and what you need to do to make sure the .js is uptodate every time you test your change… It seems fairly core to the development workflow understanding…
(I appreciate there may be a later page explaining the release process, and how the .js is created…)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thank you, yes I’d seen that page.
😃 Haha - I confess I already knew that, from the structure of this site!!! I’ve recommended Daniele’s video about it to many people, as a really effective way to structure docs…
Very good observation! It’s not clearly explained at the moment.
I think Developer workflow is the best place for it right now. I think that’s the most likely place the reader would look for it first. Potentially later a “Build process” concept doc to give an introduction to Rollup, esbuild, etc. That could be a more fitting place for an explanation for the main.js at a later point.