live-plugin | IntelliJ plugin for writing IntelliJ plugins at runtime ⚡️ | Plugin library
kandi X-RAY | live-plugin Summary
kandi X-RAY | live-plugin Summary
IntelliJ plugin for writing IntelliJ plugins at runtime ⚡️
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of live-plugin
live-plugin Key Features
live-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on live-plugin
QUESTION
I am using vue with electron to build a desktop application. I am using vue plugins to extend the functionality of the application. These vue plugins are hosted as npm modules in npm directory which can be installed from the applications plugin store using the live-plugin-manager which can be used to dynamically install plugins into plugins directory.
I am using webpack to compile the vue front-end. When I directly use these plugins, they work perfectly. I need to know if there is any way I can load these plugins dynamically from the folder each time application launches.
I have built the functionalities to install and uninstall the plugins. But I am unable to require these modules into the vue app. I tried using electron's remote.require call to fetch the module and using a loop called Vue.use() with the loaded plugin. But I keep on getting error.
...ANSWER
Answered 2019-Jul-04 at 09:40I was able to solve the issue by dynamic bundling of the plugins using browserify. I cannot share the entire code, but I will share the method I used.
- First of all I included browserify into the dependency so that electron will include it in node_modules folder.
- Then I set asar as false while packaging so that we can write into the app js file after bundling.
- Each time the app starts it creates a js plugin loading script like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install live-plugin
In the Plugins tool window select "hello-world" plugin and click "Run" button to execute the plugin (Run Plugin action with ctrl+shift+L or alt+C, alt+E shortcut). It should display a message.
Make a small modification in plugin.groovy/plugin.kts and rerun the plugin. On the second run, the previous version of the plugin will be unloaded before the code is evaluated again.
Modify plugin.groovy/plugin.kts file again so that it fails to compile/run. You should see an error message in the Run tool window.
Note that plugins are just folders with plugin.groovy or plugin.kts scripts as entry points. This means that you can, for example, copy the path to the plugin folder using the Copy Path action (ctrl/cmd+alt+C shortcut).
In the Plugins tool window click the "Plus" button (Add Plugin action) and add Groovy or Kotlin examples.
It might be useful to install Groovy or Kotlin plugin if your IDE supports them.
Run Plugins on IDE Start — run all plugins on IDE start.
Run Project Specific Plugins — run all plugins in .live-plugins project directory when the project is opened and unload them when the project is closed.
Add LivePlugin and IDE Jars to Project — useful for Groovy plugins to get auto-completion and code navigation in plugin code. (Adding jars unrelated to your project is a bit of a hack but there seems to be no major problems with it.) Note that Kotlin plugins should have auto-completion and code navigation without it.
Read (or at least skim) plugin development fundamentals.
Explore IntelliJ source code by cloning it, browsing it on GitHub or in Upsource. One useful strategy is to search for text you can see in IDE UI and then figure out how it's connected to the code which does the actual work.
PluginUtil class and liveplugin package might have some good starting points to explore IntelliJ API.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page