-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
Add bundler-friendly dependency injection #2627
Conversation
Damn, a conflict. |
Thanks for this! I'm making some pretty significant changes in the dev branch with the switch to modules so it's hard to avoid conflicts. No worries if you don't have time to fix them—I can handle it when merging. |
Merged this 🙌 I wonder if we could remove the "id" from the dependency object. Existing plugins already register themselves, and their ID via, |
Well, I think the fewer fields we have the better but how would you define the plugin's id when registering it via |
Never mind. I dug into the code and what I was picturing would not work so let's leave the ID in. One alternative approach to including bundled plugins that should work is: Reveal.registerPlugin( 'pluginID', pluginInstance )
Reveal.initialize(...) |
Indeed, but the registration via |
Add bundler-friendly dependency injection
What this PR does
It adds a new dependency injection option that allows one to import a plugin ESM-style and inject it manually in Reveal without the need for fetching another resource.
Example of it in action