Skip to content
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

Upgrade markmap to 0.14.x #102

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jawspeak
Copy link

@jawspeak jawspeak commented Nov 23, 2022

Upgrading to be able to take advantage of newer features in markmap. https://markmap.js.org/

This has no new functionality and no changes, it just upgrades the markmap dependency. A follow up PR may then have new functionality such as setting expanded levels in the mind map.

EDIT - the below is now fixed also in the 2nd commit.

Note before and after this PR I was seeing the following issue when running npm run dev (using nvm ``)

Errors/warnings on master:

bundles src/main.ts → dist...
(!) Circular dependencies
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/select.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/selectAll.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/filter.js -> node_modules/d3-selection/src/selection/index.js
...and 12 more
(!) Plugin typescript: @rollup/plugin-typescript TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type '"layout-ready"' is not assignable to parameter of type '"quit"'.
src/mindmap-view.ts: (71:31)

71             this.workspace.on('layout-ready', () => this.update()),
                                 ~~~~~~~~~~~~~~

  node_modules/obsidian/obsidian.d.ts:4153:5
    4153     on(name: 'quit', callback: (tasks: Tasks) => any, ctx?: any): EventRef;
             ~~
    The last overload is declared here.

created dist in 5.2s

Upgrade breaking changes had to resolve:
- replace transformer with Transformer
- no longer create IMarkmapOptions, but merge with Markmap.defaultOptions
  (In doing this we no longer get the font, due to this commit which removed that option markmap/markmap@7f52fdc)
…outReady(), also makes rendering more responsive
@jawspeak
Copy link
Author

The second commit fixes the warning by using the recommended updated api. (layout-ready was removed, so I updated it with the new mechanism.)

@jawspeak
Copy link
Author

jawspeak commented Dec 8, 2022

@lynchjames hopefully this is acceptable to merge, and can get out for everyone's benefit! Same as #103 too! Thanks,

@jawspeak
Copy link
Author

Bump? Checking for feedback here please @lynchjames

mdklab added a commit to mdklab/obsidian-mind-map that referenced this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant