dynamic_plugins: landing page, Dynamic EPs

This commit is contained in:
Yann Cébron 2019-12-19 11:44:02 +01:00
parent fdabc6bd31
commit c0e3bb71ad
5 changed files with 52 additions and 2 deletions

View File

@ -42,6 +42,7 @@
* [Plugin Configuration File](basics/plugin_structure/plugin_configuration_file.md)
* [Plugin Logo (Icon)](basics/plugin_structure/plugin_icon_file.md)
* [Plugin Dependencies](basics/plugin_structure/plugin_dependencies.md)
* [Dynamic Plugins](basics/plugin_structure/dynamic_plugins.md)
* [IntelliJ Platform Artifacts Repositories](reference_guide/intellij_artifacts.md)
* [Kotlin for Plugin Developers](tutorials/kotlin.md)
* [Internal Actions Menu](reference_guide/internal_actions/internal_actions_intro.md)

View File

@ -0,0 +1,31 @@
---
title: Dynamic Plugins
---
> **WARNING** Please note that the information on this page is preliminary and might change.
Starting with 2020.1 release, the ability to install, update and uninstall plugins without restarting the IDE is available in the IntelliJ Platform.
For a plugin to support this, all restrictions listed below must be met. To verify a plugin locally, run _Plugin DevKit | Plugin descriptor | Plugin.xml dynamic plugin verification_
inspection on all plugin descriptor files (required `plugin.xml` as well as any additional files).
For plugins hosted on the [JetBrains plugin repository](/plugin_repository/index.md) the built-in [Plugin Verifier](https://blog.jetbrains.com/platform/2018/07/plugins-repository-now-integrates-with-the-plugin-verification-tool/)
will run these checks automatically.
### No use of Components
No Components must be used; existing ones [must be migrated](plugin_components.md) to services, extensions or listeners.
### Action Group requires ID
All `<group>`s must declare a unique `id`.
### Use only dynamic Extensions
All extensions, whether defined in the platform itself or coming from other plugins, must be marked as dynamic (see next paragraph).
### Mark Extension Points as dynamic
All extension points provided by the plugin must adhere to specific usage rules and then [be declared](plugin_extension_points.md#dynamic-extension-points) ready for dynamic use explicitly.
### Configurables depending on Extension Points
Any `Configurable` which depends on dynamic extension points must implement `Configurable.WithEpDependencies`.
## Plugin Load/Unload Events
Register `com.intellij.ide.plugins.DynamicPluginListener` [listener](plugin_listeners.md) to receive updates on plugin load/unload events.

View File

@ -5,7 +5,7 @@ title: Plugin Components
> **WARNING** When writing new plugins, you should avoid creating components, and you should migrate existing components in your plugins to services, extensions or listeners (see below).
Plugin components are a legacy feature supported for compatibility with plugins created for older versions of the
IntelliJ Platform. Plugins using components do not support dynamic loading (the ability to install, update and
IntelliJ Platform. Plugins using components do not support [dynamic loading](dynamic_plugins.md) (the ability to install, update and
uninstall plugins without restarting the IDE).
Plugin components are defined using `<application-components>`, `<project-components>` and `<module-components>`

View File

@ -99,4 +99,19 @@ public class MyExtensionUsingService {
}
}
```
A gutter icon for the `ExtensionPointName` declaration allows navigating to the corresponding `<extensionPoint>` declaration in `plugin.xml`.
A gutter icon for the `ExtensionPointName` declaration allows navigating to the corresponding `<extensionPoint>` declaration in `plugin.xml`.
## Dynamic extension points
To support [Dynamic Plugins](dynamic_plugins.md) (2020.1 and later), an extension point must adhere to specific usage rules:
- extensions are enumerated on every use and extensions instances are not stored anywhere
- alternatively, an `ExtensionPointChangeListener` can perform necessary updates of data structures (register via `ExtensionPointName#addExtensionPointListener()`)
Extension points matching these conditions can then be marked as _dynamic_ by adding `dynamic="true"` in their declaration:
```xml
<extensionPoints>
<extensionPoint name="myDynamicExtensionPoint" beanClass="com.myplugin.MyBeanClass" dynamic="true" />
</extensionPoints>
```
> **NOTE** All non-dynamic extension points are highlighted via _Plugin DevKit \| Plugin descriptor \| Plugin.xml dynamic plugin verification_ inspection available in IntelliJ IDEA 2020.1 or later. Previous versions also highlight `dynamic` attribute as "experimental".

View File

@ -5,6 +5,9 @@ title: Notable Changes in IntelliJ Platform and Plugins API 2020.*
# 2020.1
## Notable Changes in IntelliJ Platform 2020.1
Dynamic Plugins
: [Compatible plugins](/basics/plugin_structure/dynamic_plugins.md) can be installed, updated and uninstalled without requiring IDE restart.
[`com.intellij.openapi.application.TransactionGuard`](upsource:///platform/core-api/src/com/intellij/openapi/application/TransactionGuard.java) deprecated
: Usage is deprecated and can be replaced with `com.intellij.openapi.application.Application.invokeLater()` in most cases, please consult Javadoc for more details.