question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
claremacraecommented, Oct 12, 2021

I’ve started documenting some guidelines for the documentation here, that might be a good start:

https://marcus.se.net/obsidian-plugin-docs/contribute

Thank you, yes I’d seen that page.

I also try to adhere to the following guidelines:

https://documentation.divio.com/

😃 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…

1reaction
marcusolssoncommented, Oct 12, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What exactly triggers main.ts in Angular - Stack Overflow
Yes, only angular-cli.json references it for handling the startup of the application. main.ts is not a module but a simple script-file, ...
Read more >
What are the uses of main.TS and app.module.TS in Angular 4?
main.ts is the entry point of your application , compiles the application with just-in-time and bootstraps the application .Angular can be bootstrapped in ......
Read more >
Understanding the File Structure - Rangle.io : Angular Training
ts which is the main entry point of the application. The AppModule operates as the root module of our application. The module is...
Read more >
Ahead-of-Time Compilation - ts - COOKBOOK - Angular
Ahead-of-time (AOT) vs just-in-time (JIT) ... There is actually only one Angular compiler. The difference between AOT and JIT is a matter of...
Read more >
How Angular Application Starts - Behind The $cene story!
The value of the main node is a file path that Angular is looking for - the main.ts under src folder. 2️⃣ main.ts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found