Skip to content

Commit

Permalink
add full Semantic Versioning for Shared Modules
Browse files Browse the repository at this point in the history
change storage format in the share scope
choose shared module deterministic from the same origin
remove array syntax from version and requiredVersion in schema
  • Loading branch information
sokra committed Jul 2, 2020
1 parent 07558fd commit 3fcd5f9
Show file tree
Hide file tree
Showing 33 changed files with 1,733 additions and 858 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"darkblue",
"darkgreen",
"darkred",
"eqeqeq",

"webassemblyjs",
"fsevents",
Expand Down
8 changes: 2 additions & 6 deletions declarations/_sharing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface _Sharing {
[k: string]: any;
Expand Down Expand Up @@ -48,7 +44,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -68,5 +64,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
8 changes: 2 additions & 6 deletions declarations/plugins/container/ModuleFederationPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface ModuleFederationPluginOptions {
/**
Expand Down Expand Up @@ -265,7 +261,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -285,5 +281,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
6 changes: 1 addition & 5 deletions declarations/plugins/sharing/ConsumeSharedPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
* A module that should be consumed from share scope.
*/
export type ConsumesItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

/**
* Options for consuming shared modules.
Expand Down Expand Up @@ -58,7 +54,7 @@ export interface ConsumesConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand Down
6 changes: 1 addition & 5 deletions declarations/plugins/sharing/ProvideSharedPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Provides = (ProvidesItem | ProvidesObject)[] | ProvidesObject;
* Request to a module that should be provided as shared module to the share scope (will be resolved when relative).
*/
export type ProvidesItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface ProvideSharedPluginOptions {
/**
Expand Down Expand Up @@ -55,5 +51,5 @@ export interface ProvidesConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
8 changes: 2 additions & 6 deletions declarations/plugins/sharing/SharePlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

/**
* Options for shared modules.
Expand Down Expand Up @@ -58,7 +54,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -78,5 +74,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
Loading

0 comments on commit 3fcd5f9

Please sign in to comment.