obsidian-shellcommands icon indicating copy to clipboard operation
obsidian-shellcommands copied to clipboard

Internal: Move all import statements to 'imports.ts'

Open Taitava opened this issue 3 years ago • 2 comments

I'm not going to go into much details here and so this might be cryptic, but this change should present absolutely no visible changes for users. Just a couple of sentences for myself.

Circular dependencies during compiling TypeScript to JavaScript causes often the order of imported JavaScript code to be incorrect. I borrowed an idea from this guide to centralize all imports into a single file, which I have named imports.ts.

I have already created the imports.ts file and used it mainly when developing new stuff for version 0.12.0 (e.g. #37). Now I created this issue for migrating also all old code to cetralize their imports to the same file.

Taitava avatar Mar 14 '22 15:03 Taitava

I made the changes, but currently the situation is that they made a lot more circular dependencies and the plugin cannot start at all. I might try to reorder the imports in imports.ts. That might help.

Another thing I'll try, is to change Rollup to Esbuild (issue #197) and see if it handles circular dependencies any better.

If I can't get this solved, then I'll just release 0.12.0 without this change, and postpone this to some other release.

Taitava avatar Apr 08 '22 11:04 Taitava

Changing Rollup to Esbuild did not help (I tried, but did not commit the changes). I'll look into this later.

Taitava avatar Apr 08 '22 13:04 Taitava