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

feature request: order and dependency of plugins (that use js) #1542

Open
fs111 opened this issue Dec 6, 2021 · 1 comment
Open

feature request: order and dependency of plugins (that use js) #1542

fs111 opened this issue Dec 6, 2021 · 1 comment

Comments

@fs111
Copy link

fs111 commented Dec 6, 2021

I have been playing with datasette for the last couple of weeks and it is great! I am a big fan of datasette-cluster-map and wanted to enhance it a bit with a what I would call a sub-plugin. I basically want to add more controls to the map that cluster map provides. I have been looking into its code and how the plugin management works, but it seems what I am trying to do is not doable without hacks in js.

Basically what would like to have is a way to say load my plugin after the plugins I depend on have been loaded and rendered. There seems to be no prior art where plugins have these dependencies on the js level so I was wondering if that could be added or if it exists how to do it.

Basically what I want to do is:

my-awesome-plugin has a dependency on datastte-cluster-map. Whenever datasette cluster map has finished rendering on page load, call my plugin, but no earlier. To make that work datasette probably needs some total order in which way plugins are loaded intialized.

Since I am new to datastte, I may be missing something obvious, so please let me know if the above makes no sense.

@simonw
Copy link
Owner

simonw commented Dec 15, 2021

This does make sense to me. I've been hoping to significantly improve the way JavaScript plugins work - there are some notes on that here:

Encouraging plugins such as datasette-cluster-map to emit events that can then be listened to by other plugins is a really interesting idea that I hadn't considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants