@atlassian/clientside-extensions-registry
Advanced tools
Comparing version 0.8.0-alpha-7 to 0.8.0
@@ -215,7 +215,7 @@ import { onDebug } from '@atlassian/clientside-extensions-debug'; | ||
expect(loadingState).toBe(true); | ||
registry.registerPlugin('test-fail-plugin', () => ({ type: 'link' })); | ||
registry.registerExtension('test-fail-plugin', () => ({ type: 'link' })); | ||
deferredResources.resolve(); | ||
}; | ||
const registerPluginWarnCase: LocationSubjectObserver = ({ descriptors, loadingState }) => { | ||
const registerExtensionWarnCase: LocationSubjectObserver = ({ descriptors, loadingState }) => { | ||
expect(loadingState).toBe(false); | ||
@@ -228,3 +228,3 @@ expect(descriptors).toMatchObject(testDescriptors); | ||
const cases = [loadingCase, registerPluginWarnCase]; | ||
const cases = [loadingCase, registerExtensionWarnCase]; | ||
@@ -247,7 +247,7 @@ registry.getLocation('test-location').subscribe(payload => { | ||
expect(loadingState).toBe(true); | ||
registry.registerPlugin('test-plugin-1', attributesProvider); | ||
registry.registerExtension('test-plugin-1', attributesProvider); | ||
deferredResources.resolve(); | ||
}; | ||
const registerPluginWarnCase: LocationSubjectObserver = ({ descriptors, loadingState }) => { | ||
const registerExtensionWarnCase: LocationSubjectObserver = ({ descriptors, loadingState }) => { | ||
const [firstDescriptor] = descriptors; | ||
@@ -263,3 +263,3 @@ const [firstTestDescriptor, secondTestDescriptor] = testDescriptors; | ||
const cases = [loadingCase, registerPluginWarnCase]; | ||
const cases = [loadingCase, registerExtensionWarnCase]; | ||
@@ -266,0 +266,0 @@ registry.getLocation('test-location').subscribe(payload => { |
@@ -107,5 +107,5 @@ import { onDebug } from '@atlassian/clientside-extensions-debug'; | ||
/** | ||
* Plugin's resources use this API to register their attribute factories. | ||
* Extension entry-points use this API to register their attribute providers. | ||
*/ | ||
registerPlugin(key: string, attributesProvider: PluginAttributesProvider) { | ||
registerExtension(key: string, attributesProvider: PluginAttributesProvider) { | ||
const pluginDescriptor = ClientPluginsRegistry.getPluginsByKey(key, this.plugins); | ||
@@ -130,5 +130,5 @@ | ||
// due to the fact that we will load all resources at once | ||
// we can assume that all registerPlugin calls for a location come at the same time | ||
// we can assume that all registerExtension calls for a location come at the same time | ||
// this - combined with the 'deferred' calling nature of the `notify` method | ||
// means we do not have to wait for the last registerPlugin call | ||
// means we do not have to wait for the last registerExtension call | ||
const loadingState = false; | ||
@@ -135,0 +135,0 @@ |
@@ -14,3 +14,7 @@ export interface BasePluginDescriptor { | ||
export interface PluginAttributes { | ||
interface PluginAction { | ||
onAction?: (...args: unknown[]) => void; | ||
} | ||
export interface PluginAttributes extends PluginAction { | ||
[key: string]: unknown; | ||
@@ -17,0 +21,0 @@ } |
{ | ||
"name": "@atlassian/clientside-extensions-registry", | ||
"version": "0.8.0-alpha-7", | ||
"version": "0.8.0", | ||
"description": "Implements the browser runtime for the client-side extensions.", | ||
@@ -59,4 +59,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"@atlassian/clientside-extensions-base": "^0.8.0-alpha-7", | ||
"@atlassian/clientside-extensions-debug": "^0.8.0-alpha-7" | ||
"@atlassian/clientside-extensions-base": "^0.8.0", | ||
"@atlassian/clientside-extensions-debug": "^0.8.0" | ||
}, | ||
@@ -69,3 +69,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "147482db3e79c729b71b2e8e3f2fe1b7aa4d3906" | ||
"gitHead": "add8bc85a6b8e345a92c9b10e6a3e0a83fadf5f0" | ||
} |
27539
523