Commit graph

256 commits

Author SHA1 Message Date
Spencer fa93a81ba6
[kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911)
Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 18:43:17 -07:00
Spencer 44925311fc
Fix kbn/optimizer tests (#70827)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-07-06 11:13:17 -07:00
Pierre Gayvallet 2a43b48ac7
remove snapshot from disabled test suite. (#70769) 2020-07-06 09:50:04 +01:00
Tiago Costa c96d9b4ba3
skip flaky suite (#70764) 2020-07-06 00:55:02 +01:00
Tiago Costa 86672a7b07
skip flaky suite (#70762) 2020-07-05 23:00:13 +01:00
Spencer f5b280007f
[kbn/optimizer] only build specified themes (#70389)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-07-02 15:06:32 -07:00
Pierre Gayvallet 8485d2fbac
Implement recursive plugin discovery (#68811)
* implements recursive scanning in plugin discovery system

* update optimizer to find plugins in sub-directories

* update renovate

* update optimizer IT snapshot

* refactor processPluginSearchPaths$ and add test for inaccessible manifest

* add symlink test

* add maxDepth to the optimizer

* adapt mockFs definitions

* remove `flat` usage
2020-06-30 07:51:12 +02:00
patrykkopycinski cc4c1729d1
Bump jest related packages (#58095) 2020-06-20 21:05:09 +02:00
Spencer e03f2428b1
[BundleRefPlugin] resolve imports to files too (#69241)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-06-16 15:16:35 -07:00
Spencer db1df7bed0
[kbn/optimizer] fix windows compatibility (#69304)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-06-16 12:57:34 -07:00
Alexey Antonov c98845c7c7
Update vega version (#68639)
* update vega version

* a11y skip test

* a11y skip test attempt 2

* adding back all a11y tests

* fix failed karma test

* remove extra  0BSD license

* coalesce yarn.lock versions a little

* update kbn/pm dist

* fix CI

* fix Vega View for ML

Co-authored-by: Michail Yasonik <michail.yasonik@elastic.co>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-16 12:35:34 +03:00
Spencer 7e328417ab
[kbn/optimizer] share all plugin bundles (#68986)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-15 22:15:31 -07:00
Joe Portner 6f084dfa92
Bump webpack packages (#68716)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-06-12 18:57:28 -04:00
Mikhail Shustov f593455a62
Bump TypeScript to v3.9 (#67666)
* add babel support for export type

* bump ts version to 3.9.3

* rebuild kbn-pm

* bump typescript-eslint

* fix error in security plugin UI

* check export as works

* fix app migration type

* use correct test subj attribute

* fix errors from the old PR

* embeddable is already passed in props

* explicitly define type of fetch

* add some types for viz

* fix fetch type p.2

* add null to allow spreading without type errors due to override

* add type guard to fix type error

* cast to any, since cannot assign unknown

* add timestamp to known types

* fix type error in fetch

* fix type error. id is always defined in attibutes

* declare a type

* move ts-ignore to the lines with errors

* declare tuple type explicitly

* mute type error. cannot assign unknown

* fix errors. id is always defined

* fix error type

* fix override errors. id is always defined

* fix error. extends any doesn't work anymore

* fix type error. type is always defined

* env doesn't always contain values

* fix type error

* cast to string

* add: logs is already declared in getNodeLogsUrl

* state is already  passed in props

* fix some errors in timelion

* number of fragments is always defined

* 'absolute' is not just string, but value

* TEMP: option is always defined

* always true if cast to promise manually

* both props are always defined

* explicitly define returned SO type

* workaround type

* bump tslib to be compatible with ts v3.9

* test private property

* rebuild kbn-pm

* Fix ts errors for beats management

* Fix type inference broken by the TS 3.9 upgrade

* Fix ingest manager saved object attributes typings

* Fix TS errors in cross_cluster_replication and index_management.

* Fix TS error in Watcher.

* roll back colorRange wrong type

* fix security plugin types

* TypeScript 3.9 fixes for APM

* Fix ColorRange types.

* fix actions & alerts errors. ByGidi

* fix lists error

* More APM fixes

* Remove paramaterization from `removeEmpty in agent config SettingsPage component (it's only used there and doesn't need to be parameterized.)
* Add option chain for case in registerTransactionDurationAlertType
* Cast `overallValue` in transform_metrics_chart
* Use more specific type for custom link filters
* Add more option chaining for local UI filters buckets response
* Remove unused parameters from routes
* Fix getProjection type parameter
* Use destructuring in serviceNodesLocalFiltersRoute to hide `never` error
* Revert `UnionToIntersection` change in `AggregationResponseMap`

Fixes #67804.

* fix platform type error

* Fix visualizations types.

* Fix data plugin types.

* bump TS version to 3.9.5

* Fix telemetry TS errors

* Fix dashboard code

* Adding Canvas Fixes for TS 3.9

* Fix case and security_solution types

* roll back to the old export syntax. new one might cause problems in api-extractor

* update docs

* Fix timelion code

* Fix meta

* Fix types

* fix type errors om ingest_manager

* bump babel deps

* enable private props & methods syntax

* update kbn-pm dist

* whitelist 0BSD license

* use @babel/plugin-proposal-private-methods in default set as well

* disable new babel plugins

* Revert "disable new babel plugins"

This reverts commit 04d959431d.

* cleanup security_solution types

* Fixes type error for newer TypeScript

* update docs

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Nathan L Smith <smith@nlsmith.com>
Co-authored-by: Walter Rafelsberger <walter@elastic.co>
Co-authored-by: Luke Elmers <luke.elmers@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: Tim Roes <tim.roes@elastic.co>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: FrankHassanabad <frank.hassanabad@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-11 10:04:09 +02:00
Spencer 728a4b23e6
share core bundle with plugins (#67892)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-06-02 14:18:37 -07:00
Spencer 402018856e
[kbn/optimizer] update public path before imports (#67561)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-05-29 14:21:14 -07:00
Spencer 6288096f62
[kbn/optimizer] use execa to fork workers (#67730)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-05-29 10:34:58 -07:00
Spencer 55679d75dd
[kbn/optimizer] exclude "cache" config from cache key, diff actually compared values (#67232)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-27 12:01:29 -07:00
restrry bf04235dae apply prettier styles 2020-05-22 09:08:58 +02:00
spalger dcfa485009 Revert "[kbn/optimizer] poll parent process to avoid zombie processes (#67059)"
This reverts commit e824ac3ba9.
2020-05-21 20:52:55 -07:00
spalger 556ae523c8 Revert "[kbn/optimizer] remove disconnect listener (#67161)"
This reverts commit 90fc521d21.
2020-05-21 20:52:43 -07:00
Spencer 7db72531fd
[kbn/optimizer] ensure build script can prime cache (#67020) 2020-05-21 10:01:09 -07:00
Spencer 90fc521d21
[kbn/optimizer] remove disconnect listener (#67161) 2020-05-21 09:58:15 -07:00
Tyler Smalley c675301a87
[build] Removes commonjs transforms (#66506)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-21 09:43:31 -07:00
Spencer ffe7341f27
[kbn/optimizer] require fsevents on macos (#67147) 2020-05-21 02:20:14 -07:00
Spencer e824ac3ba9
[kbn/optimizer] poll parent process to avoid zombie processes (#67059) 2020-05-20 07:40:46 -07:00
Tiago Costa d7f847e91d
fix(NA): noParse regex for windows on kbn optimizer (#65755) 2020-05-08 00:45:57 +01:00
Spencer d988ebee97
Collect more build metrics (#65408) 2020-05-07 10:37:07 -07:00
Josh Dover 306a5fe55e
Use brotli compression for some KP assets (#64367) 2020-05-04 10:53:06 -06:00
Spencer 0d4cfba4b4
share single data plugin bundle (#64549) 2020-04-29 09:44:56 -07:00
Spencer 00ec971b6e
Implement basic CI metric reporting (#64263) 2020-04-27 13:24:52 -07:00
Maryia Lapata 2ace269a26
[NP] Vega migration (#63849)
* Vega migartion

* Move mocha tests to legacy

* Fix TS

* Update .i18nrc.json

* Move mocks to vis_type_vega

* Fix issue with babel and vega deps

* Update mocha test

* Mock services

* Update vega_request_handler.ts

* don't parse vega-lib/build/vega.js

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-04-24 16:25:08 +03:00
Josh Dover 3e0907fabf
Use runtime publicPath for KP plugin bundles (#64226) 2020-04-23 09:13:00 -06:00
Tiago Costa ebf55030b0
fix(NA): node module main field resolution for new platform (#63886)
* fix(NA): node module main field resolution for new platform

* chore(NA): remove browserify from kbn optimizer main fields

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-23 13:49:07 +01:00
Josh Dover fc1f4f2695
Do not serve legacy JS when serving a Kibana Platform applicat… (#61011) 2020-04-22 11:14:21 -06:00
Vadim Dalecky b5762eb5ff
Example plugins in X-Pack (#63823)
* feat: 🎸 add example plugin ability to X-Pack

* style: 💄 spread array items from one array

* chore: 🤖 add x-pack/examples tsconfigs to global list

* fix: 🐛 don't import non-existing plugin

* fix: 🐛 fix TypeScript error

* test: 💍 update Jest snapshot
2020-04-17 20:15:36 +02:00
Spencer 369ddff951
[kbn/optimizer] link to kibanaReact/kibanaUtils plugins (#62720)
* [kbn/optimizer] link to data/kibanaReact/kibanaUtils plugins

* depend on normalize-path package

* typos

* avoid loading kibanaUtils and kibanaReact from urls

* update types and tests, now that whole plugin is exported to window

* update snapshot, removed export of `plugins` property

* fix condition, ignore things NOT in data/react/utils

* make es_ui_shared a "static bundle" too

* move kibana_utils/common usage to /public

* convert some more /common usage to /public

* use async-download/ordered-execution for bootstrap script

* fix typo

* remove kibanaUtils bundle

* remove kibanaReact bundle

* Revert "remove kibanaReact bundle"

This reverts commit f14e9ee604.

* Revert "remove kibanaUtils bundle"

This reverts commit a64b2a7f64.

* stop linking to the data plugin

* add comment pointing to async-download info

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-08 12:15:48 -07:00
Spencer e6c23ea9b2
[kbn/ui-shared-deps] expand and split (#62364)
* [kbn/ui-shared-deps] expand and split

* add two import styles for eui/react-dom that are new

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-03 14:11:36 -07:00
Spencer 7d58f95953
[optimizer] validate the syntax of bundled node_modules (#59972)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-30 15:59:43 -07:00
Mikhail Shustov ab39ceba8f
Serve static assets from NP (#60490)
* add hapi.inert plugin to NP

* update tests

* move serving static assets

* update tests

* add functional tests

* fix type errors. Hapi.Request doesn't support typings for payload

* update docs

* remove comment

* move assets to NP

* update all assets references

* address Spencer's comments

* move ui settings migration to migration examples

* document legacy plugin spec

* move platform assets test to integration_tests

* address Spencer's comment p.2

* try to fix type errors

* fix merge commit

* update tests
2020-03-27 14:24:28 +01:00
Mikhail Shustov a8f92c5e0b
bump up babel version (#61037)
* bump babel version

* build kbm-pm

* refresh transitive @babel/* versions to kick yarn into shape

* update kbn/pm dist

Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-03-25 16:37:30 +01:00
Spencer 0d0973869d
[kbn/optimizer] add test to verify that dynamic imports keep w… (#59065)
* [kbn/optimizer] add test to verify that dynamic imports keep working

* sort files before adding to cache

* oops, committed tmp repo
2020-03-03 08:15:32 -07:00
Spencer bb6fd0bf4f
[kbn/optimizer] fix ui/* url rewrites in dist (#58627)
* [kbn/optimizer] fix ui/* url rewrites in dist

* add tests to verify styles are built correctly and ui-rewrites are happening

* clarify change to dirs creation

* create tested & shared parsePath helper

* update renovate config

* split implementation of parsePath for dir and file paths

* switch to valid css property

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-02 15:15:44 -07:00
Spencer a3e68a1830
Revert "[SIEM] apollo@3 (#51926)" and "[SIEM][CASE] Init Confi… (#58806)
* Revert "[SIEM] apollo@3 (#51926)"

This reverts commit 320e292ea8.

* Revert "[SIEM][CASE] Init Configure Case Page (#58121)"

This reverts commit 967bef7b38.

* update a snapshot...
2020-02-28 11:42:34 -07:00
patrykkopycinski 320e292ea8
[SIEM] apollo@3 (#51926) 2020-02-27 09:25:37 +01:00
Spencer 0e2363615d
Fix flaky jest test (#58402)
* Revert "Temporarily removes kbn-optimizer cache key tests (#58318)"

This reverts commit e64eff0a3d.

* [kbn-optmizer] avoid mocking fs exports

* overwrite ciGroup script to support jest in flaky testing job

* limit jest workers to 3 so that concurrent runners have space to operate

* Revert "limit jest workers to 3 so that concurrent runners have space to operate"

This reverts commit 1a2f882f6d.

* Revert "overwrite ciGroup script to support jest in flaky testing job"

This reverts commit 548db61722.
2020-02-25 13:59:04 -07:00
Spencer 33334132ea
[kbn/optimizer] disable parallelization in terser plugin (#58396)
* [kbn/optimizer] disable parallelization in terer plugin

* use more workers when building the dist
2020-02-24 17:07:36 -07:00
Tyler Smalley e64eff0a3d
Temporarily removes kbn-optimizer cache key tests (#58318)
While we investigate why they are interfering with other tests.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-24 06:02:27 -08:00
Spencer 8686fc99dc
[kbn/optimizer] include bootstrap cache key in optimizer cache key (#58176)
* [kbn/optimizer] include bootstrap cache key in optimizer cache key

* remove cache buster

* update cache keys tests

* move mocks
2020-02-21 09:14:28 -07:00
Spencer 4aedf2b75b
add monaco to kbn/ui-shared-deps and load required features for all uses (#58075)
* add monaco to kbn/ui-shared-deps and load required features for all uses

* forgot to save a change

* remove unused imports

* include a cache buster to counteract issue #58077

* include monaco.ts in ts project
2020-02-20 12:58:42 -07:00
Spencer fbae654da6
[kbn/optimizer] emit success event from reducer when all bundles cached (#57945)
* emit success event from reducer when all bundles cached

* verify that infinite streams can be broken by unsubscribing

* shift naming a smidge

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-19 11:19:50 -07:00
Spencer 7cf33c14dd
[@kbn/optimizer] rewrite url(ui/*) in legacy scss files (#57869)
* [@kbn/optimizer] rewrite url(ui/*) in legacy scss files

* update kbn/pm dist
2020-02-18 12:43:55 -07:00
Spencer a838e6392a
[@kbn/optimizer] prevent error when all bundles are cached (#57871) 2020-02-18 10:57:15 -07:00
Spencer 5d99576ab1
[kbn/optimizer] throw errors into stream on invalid completion (#57735) 2020-02-14 16:17:07 -07:00
Spencer 343bc9c303
[kbn/optimizer] Fix windows support (#57592)
* [kbn/optimizer] simplify run_workers.ts a smidge

* use Path.resolve() to create windows paths from normalized ones

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 06:54:24 -07:00
Spencer 4e8ab56497
build immutable bundles for new platform plugins (#53976)
* build immutable bundles for new platform plugins

* only inspect workers if configured to do so

* [navigation] use an index.scss file

* add yarn.lock symlink

* set pluginScanDirs in test so fixtures stay consistent

* cleanup helpers a little

* fix type error

* support KBN_OPTIMIZER_MAX_WORKERS for limiting workers via env

* test support for KBN_OPTIMIZER_MAX_WORKERS

* expand the available memory for workers when only running one or two

* add docs about KBN_OPTIMIZER_MAX_WORKERS environment variable

* fix README link

* update kbn/pm dist

* implement bundle caching/reuse

* update kbn/pm dist

* don't check for cache if --no-cache is passed

* update renovate config

* standardize on index.scss, move console styles over

* add support for --no-cache to cli

* include worker config vars in optimizer version

* ignore concatenated modules

* update integration test

* add safari to browserslist to avoid user-agent warnings in dev

* update docs, clean up optimizer message/misc naming

* always handle initialized messages, don't ignore states that are attached to specific events

* reword caching docs, add environment var to disable caching

* tweak logging and don't use optimizer.useBundleCache as that's disabled in dev

* handle change notifications

* batch changes for 1 second

* rename CompilerState type to CompilerMsg

* getChanges() no longer needs to assign changes to dirs

* remove unused deps

* split up run_worker.ts and share cacheKey generation logic

* add a couple docs

* update tests and remove unused imports

* specify files when creating bundle cache key

* remove one more unused import

* match existing dev cli output more closely

* update kbn/pm dist

* set KBN_NP_PLUGINS_BUILT to avoid warning in CI

* avoid extending global window type

* add note to keep pluginScanDirs in sync

* pass browserslistEnv in workerConfig so it is used for cache key

* load commons.bundle.js in parallel too

* emit initialized+success states if all bundles are cached

* load bootstraps as quickly as possible

* skip flaky suite

* bump

* update jest snapshots

* remove hashing from cache key generation

* remove unnecessary non-null assertion

* improve docs and break up Optimizer#run()

* remove unused import

* refactor kbn/optimizer to break up observable logic, implement more helpful cache invalidation logic with logging

* fix tests

* add initializing phase

* avoid rxjs observable constructor

* remove unnecessary rxjs helper, add tests for bundle cache

* update consumers of optimizer

* update readme with new call style

* replace "new platform" with "kibana platform"

* fix a couple more renames

* add support for several plain-text file formats

* fix naming of OptimizerMsg => OptimizerUpdate, use "store" naming too

* one more OptimizerMsg update

* ensure bundles are not cached when cache config is false

* test for initializing states and bundle cache events

* remove unnecessary timeout change

* Remove unnecessary helpers

* Add tests for BundleCache class

* Add tests for Bundle class

* test summarizeEvent$

* missing paths are no longer listed in mtimes map

* add tests for optimizer/cache_keys

* Add some extra docs

* Remove labeled loop

* add integration test for kbn-optimizer watcher components

* querystring-browser removed

* tweak logging a smidge, improve info and final message

* remove unused imports

* remove duplication of getModuleCount() method

* move type annotation that validates things

* clear up the build completion message

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 19:42:42 -07:00