-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * [canvas][storybook] Improve Storybook Performance (#34757) * [WIP] Initial commit * [canvas][storybook] Improving Storybook Performance * Adding docs; fixing bugs * Address feedback; add todo * Delete stats.json
- Loading branch information
1 parent
291320c
commit ee4a76f
Showing
16 changed files
with
399 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
const path = require('path'); | ||
|
||
const DLL_NAME = 'canvasStorybookDLL'; | ||
const KIBANA_ROOT = path.resolve(__dirname, '../../../..'); | ||
const BUILT_ASSETS = path.resolve(KIBANA_ROOT, 'built_assets'); | ||
const DLL_OUTPUT = path.resolve(BUILT_ASSETS, DLL_NAME); | ||
|
||
module.exports = { | ||
DLL_NAME, | ||
KIBANA_ROOT, | ||
BUILT_ASSETS, | ||
DLL_OUTPUT, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
// This file defines CSS and Legacy style contexts for use in the DLL. This file | ||
// is also require'd in the Storybook config so that the Storybook Webpack instance | ||
// is aware of them, and can load them from the DLL. | ||
|
||
// Pull in the built CSS produced by the Kibana server, but not | ||
// the Canvas CSS-- we want that in the HMR service. | ||
const css = require.context( | ||
'../../../../built_assets/css', | ||
true, | ||
/\.\/plugins\/(?!canvas).*light\.css/ | ||
); | ||
css.keys().forEach(filename => { | ||
css(filename); | ||
}); | ||
|
||
// Include Legacy styles | ||
const uiStyles = require.context( | ||
'../../../../src/legacy/ui/public/styles', | ||
false, | ||
/[\/\\](?!mixins|variables|_|\.|bootstrap_(light|dark))[^\/\\]+\.less/ | ||
); | ||
uiStyles.keys().forEach(key => uiStyles(key)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- | ||
This file is looked for by Storybook and included in the HEAD element | ||
if it exists. This is how we load the DLL content into the Storybook UI. | ||
--> | ||
<script src="/dll.js"></script> | ||
<link href="/dll.css" rel="stylesheet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.