Skip to content

Commit

Permalink
Attempt to reduce Core bundle size with type exports. (#92221)
Browse files Browse the repository at this point in the history
* compile core files as isolated modules

* fix export problems for isolated modules

* apply changes to kbn-test as core imports from it

* fix some exports

* fix lint errors

* update new exports

* fix eslint error

* expand export * where it is possible

* update docs

* update docs

* fix eslint error
  • Loading branch information
mshustov authored Mar 3, 2021
1 parent ccc70b4 commit f5e8b10
Show file tree
Hide file tree
Showing 88 changed files with 5,230 additions and 5,286 deletions.
6,001 changes: 2,969 additions & 3,032 deletions api_docs/core.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions api_docs/core_application.json
Original file line number Diff line number Diff line change
Expand Up @@ -1652,19 +1652,19 @@
],
"enums": [
{
"id": "def-public.AppLeaveActionType",
"id": "def-public.AppNavLinkStatus",
"type": "Enum",
"label": "AppLeaveActionType",
"label": "AppNavLinkStatus",
"tags": [
"public"
],
"description": [
"\nPossible type of actions on application leave.\n"
"\nStatus of the application's navLink.\n"
],
"source": {
"path": "src/core/public/application/types.ts",
"lineNumber": 540,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/public/application/types.ts#L540"
"lineNumber": 40,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/public/application/types.ts#L40"
},
"initialIsOpen": false
},
Expand All @@ -1686,19 +1686,19 @@
"initialIsOpen": false
},
{
"id": "def-public.AppNavLinkStatus",
"id": "def-public.AppLeaveActionType",
"type": "Enum",
"label": "AppNavLinkStatus",
"label": "AppLeaveActionType",
"tags": [
"public"
],
"description": [
"\nStatus of the application's navLink.\n"
"\nPossible type of actions on application leave.\n"
],
"source": {
"path": "src/core/public/application/types.ts",
"lineNumber": 40,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/public/application/types.ts#L40"
"lineNumber": 540,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/public/application/types.ts#L540"
},
"initialIsOpen": false
}
Expand Down
216 changes: 108 additions & 108 deletions api_docs/core_http.json
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,82 @@
},
"initialIsOpen": false
},
{
"id": "def-server.RouteValidationError",
"type": "Class",
"tags": [
"public"
],
"label": "RouteValidationError",
"description": [
"\nError to return when the validation is not successful."
],
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCoreHttpPluginApi",
"section": "def-server.RouteValidationError",
"text": "RouteValidationError"
},
" extends ",
"SchemaTypeError"
],
"children": [
{
"id": "def-server.RouteValidationError.Unnamed",
"type": "Function",
"label": "Constructor",
"signature": [
"any"
],
"description": [],
"children": [
{
"type": "CompoundType",
"label": "error",
"isRequired": true,
"signature": [
"string | Error"
],
"description": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
},
{
"type": "Array",
"label": "path",
"isRequired": true,
"signature": [
"string[]"
],
"description": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
}
],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 15,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L15"
},
"initialIsOpen": false
},
{
"id": "def-server.KibanaRequest",
"type": "Class",
Expand Down Expand Up @@ -2393,8 +2469,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 145,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L145"
"lineNumber": 144,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L144"
}
},
{
Expand All @@ -2409,8 +2485,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 153,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L153"
"lineNumber": 152,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L152"
}
},
{
Expand All @@ -2423,8 +2499,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 155,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L155"
"lineNumber": 154,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L154"
},
"signature": [
"URL"
Expand All @@ -2440,8 +2516,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 157,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L157"
"lineNumber": 156,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L156"
},
"signature": [
"Readonly<{ path: string; method: ",
Expand Down Expand Up @@ -2471,8 +2547,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 163,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L163"
"lineNumber": 162,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L162"
},
"signature": [
{
Expand All @@ -2494,8 +2570,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 168,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L168"
"lineNumber": 167,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L167"
}
},
{
Expand All @@ -2508,8 +2584,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 171,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L171"
"lineNumber": 170,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L170"
},
"signature": [
{
Expand All @@ -2531,8 +2607,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 173,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L173"
"lineNumber": 172,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L172"
},
"signature": [
{
Expand All @@ -2552,8 +2628,8 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 174,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L174"
"lineNumber": 173,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L173"
},
"signature": [
"{ isAuthenticated: boolean; }"
Expand All @@ -2569,8 +2645,8 @@
],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 182,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L182"
"lineNumber": 181,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L181"
},
"signature": [
"URL",
Expand All @@ -2596,8 +2672,8 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 188,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L188"
"lineNumber": 187,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L187"
}
},
{
Expand All @@ -2610,8 +2686,8 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 189,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L189"
"lineNumber": 188,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L188"
}
},
{
Expand All @@ -2624,8 +2700,8 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 190,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L190"
"lineNumber": 189,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L189"
}
},
{
Expand All @@ -2638,8 +2714,8 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 191,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L191"
"lineNumber": 190,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L190"
}
},
{
Expand All @@ -2652,17 +2728,17 @@
"description": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 194,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L194"
"lineNumber": 193,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L193"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/core/server/http/router/request.ts",
"lineNumber": 187,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L187"
"lineNumber": 186,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L186"
}
}
],
Expand All @@ -2672,82 +2748,6 @@
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/request.ts#L90"
},
"initialIsOpen": false
},
{
"id": "def-server.RouteValidationError",
"type": "Class",
"tags": [
"public"
],
"label": "RouteValidationError",
"description": [
"\nError to return when the validation is not successful."
],
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCoreHttpPluginApi",
"section": "def-server.RouteValidationError",
"text": "RouteValidationError"
},
" extends ",
"SchemaTypeError"
],
"children": [
{
"id": "def-server.RouteValidationError.Unnamed",
"type": "Function",
"label": "Constructor",
"signature": [
"any"
],
"description": [],
"children": [
{
"type": "CompoundType",
"label": "error",
"isRequired": true,
"signature": [
"string | Error"
],
"description": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
},
{
"type": "Array",
"label": "path",
"isRequired": true,
"signature": [
"string[]"
],
"description": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 16,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L16"
}
}
],
"source": {
"path": "src/core/server/http/router/validator/validator_error.ts",
"lineNumber": 15,
"link": "https://github.com/elastic/kibana/tree/mastersrc/core/server/http/router/validator/validator_error.ts#L15"
},
"initialIsOpen": false
}
],
"functions": [],
Expand Down
Loading

0 comments on commit f5e8b10

Please sign in to comment.