Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT EXPLORATION] chore(NA): upgrade to webpack 5 #191106

Draft
wants to merge 204 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
905d83f
chore(NA): upgrade into webpack v5
mistic Aug 20, 2024
1285a03
chore(NA): correctly use devtool on worker config
mistic Aug 20, 2024
94789bc
chore(NA): upgrades bundle_remotes_plugin
mistic Aug 21, 2024
095f9ab
fix(NA): theme_loader getOptions
mistic Aug 21, 2024
50421c0
fix(NA): modules and fileDependencies loop
mistic Aug 21, 2024
756aa74
fix(NA): missing raw request processor
mistic Aug 21, 2024
31fd74c
chore(NA): correctly applies bundle_remote_plugin conversion
mistic Aug 21, 2024
1f5495a
chore(NA): update webpack sources and loader
mistic Aug 21, 2024
eb14c00
chore(NA): do not use esm by default
mistic Aug 22, 2024
d1124be
chore(NA): do not use esm by default
mistic Aug 22, 2024
41d526c
chore(NA): some more progress on bundle_remote_module
mistic Aug 22, 2024
40fbb44
chore(NA): update bundle remote module
mistic Aug 22, 2024
d2b5e17
fix(NA): bundle_remote_module
mistic Aug 22, 2024
881127a
chore(NA): add all polyfills
mistic Aug 22, 2024
c0e8e74
fix(NA): usage of node:crypto
mistic Aug 22, 2024
6369ccd
chore(NA): use relative import on sass file
mistic Aug 22, 2024
a2812bd
chore(NA): more polyfills for ui shared deps
mistic Aug 22, 2024
bf811bb
chore(NA): eslint fix
mistic Aug 22, 2024
3d3aff0
fix(NA): async code generation for bundles
mistic Aug 22, 2024
7fa674b
fix(NA): include process polyfills
mistic Aug 22, 2024
1845914
chore(NA): remove specific polyfills from package.json
mistic Aug 22, 2024
e72c3ce
chore(NA): merge and solve conflicts with main
mistic Aug 22, 2024
b91ecd0
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 22, 2024
69ab2f7
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 22, 2024
0efc8de
chore(NA): max asset size as before
mistic Aug 23, 2024
09f5e0d
fix(NA): url assets limits
mistic Aug 23, 2024
6f975d8
chore(NA): merge and solve conflicts with main
mistic Aug 23, 2024
a13fa3d
fix(NA): recover old chunkIds algorithm
mistic Aug 24, 2024
5b23938
chore(NA): performance experiments
mistic Aug 26, 2024
dcb6a97
chore(NA): merge and solve conflicts with main
mistic Aug 26, 2024
e95280e
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Aug 26, 2024
f8c1556
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 26, 2024
8131150
chore(NA): added some performance tunning settings to test
mistic Aug 27, 2024
edaf5b8
chore(NA): upgrade babel-loader
mistic Aug 27, 2024
a4f13a8
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Aug 27, 2024
05d9170
chore(NA): removes warnings for fitlers
mistic Aug 27, 2024
e7f7d76
chore(NA): migrates bundle metrics plugin and populate bundle cache p…
mistic Aug 27, 2024
af2136c
chore(NA): add some extra info to the migrations
mistic Aug 28, 2024
c1dff0d
fix(NA): jest raw loader; moduleIds on ui-shared-deps; resolutions on…
mistic Oct 2, 2024
5ec9129
fix(NA): stats undefined
mistic Oct 2, 2024
5cafd4d
fix(NA): ignore_not_found_export_plugin for webpack v5 on kbn/storybook
mistic Oct 2, 2024
e53f578
fix(NA): stages on bundle metrics plugin and emit stats plugin
mistic Oct 2, 2024
e71b1db
chore(NA): merge and solve conflicts with main
mistic Oct 2, 2024
d6dfb11
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Oct 2, 2024
8cf5787
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Oct 2, 2024
eb99fd1
fix(NA): domain-browser resolution
mistic Oct 2, 2024
e80c9c3
fix(NA): parse_kbn_import_req to exclude raw-loader imports
mistic Oct 3, 2024
ae35b47
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Oct 3, 2024
9a4ebd3
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 3, 2024
2e3a228
chore(NA): disable treeShaking
mistic Oct 3, 2024
d192271
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Oct 3, 2024
4765204
chore(NA): upgrade terser
mistic Oct 3, 2024
0984714
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 3, 2024
d1bc882
test(NA): update snapshot for jest int test packages/kbn-plugin-helpe…
mistic Oct 3, 2024
b5c7e22
fix(NA): polyfill cypress webpack config
mistic Oct 3, 2024
4fa103e
fix loading raw ace worker
Ikuni17 Oct 3, 2024
931ad5a
update snapshot
Ikuni17 Oct 3, 2024
4ee20f9
fix type errors
Ikuni17 Oct 3, 2024
61daf93
add path-browserify fallback
Ikuni17 Oct 3, 2024
9476213
fix(NA): storybook webpack config migration
mistic Oct 3, 2024
394001a
chore(NA): merge and solve conflicts with upstream
mistic Oct 3, 2024
c07dbdf
fix(NA): resolver request basename
mistic Oct 3, 2024
fd59c9a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Oct 3, 2024
a798996
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 3, 2024
1e53307
fix(NA): remove asUrl
mistic Oct 4, 2024
9a68ed6
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Oct 4, 2024
4246064
fix(NA): profiling plugins
mistic Oct 4, 2024
d149400
fix(NA): get back asUrl resourceQuery for previous inline file-loader
mistic Oct 4, 2024
0f4b248
chore(NA): test by removing statoscope
mistic Oct 4, 2024
00b4776
chore(NA): upgrades webpack_bundle_analyzer to machineType n2-standard-8
mistic Oct 4, 2024
c791f0f
chore(NA): turn on Statoscope plugin again
mistic Oct 4, 2024
62b8123
chore(NA): disable webpack-visualizer-plugin2 plugin
mistic Oct 4, 2024
8d0460c
fix(NA): quick checks eslint failure
mistic Oct 4, 2024
0353e62
fix(NA): removing the webpack visualizer plugin
mistic Oct 4, 2024
d0f6184
fix(NA): remove polyfill all integration from webpack
mistic Oct 4, 2024
2471dd3
fix(NA): including buffer on ui-shared-deps
mistic Oct 4, 2024
4fcb4e5
fix(NA): eslint on packages/kbn-storybook/src/webpack.config.ts
mistic Oct 4, 2024
ab021b6
fix(NA): add missing polyfills on process and buffer
mistic Oct 5, 2024
ebe83d6
fix(NA): add process polyfill into ui-shared-deps-src
mistic Oct 5, 2024
e0f6b3f
fix(NA): include Buffer polyfill in @kbn/optimizer worker confifg
mistic Oct 5, 2024
1bb0882
chore(NA): remove targets and mainFields
mistic Oct 5, 2024
a289ab6
fix(NA): add target web back
mistic Oct 5, 2024
5952c3f
chore(NA): same old polyfill versions
mistic Oct 5, 2024
81f1952
chore(NA): introduce old node-libs-browser polyfills
mistic Oct 7, 2024
8c4a6d4
fix(NA): quick-checks
mistic Oct 7, 2024
84c6eee
chore(NA): properly export transient dependencies on dll manifest
mistic Oct 8, 2024
37b891d
chore(NA): try to use sideEffects
mistic Oct 8, 2024
4acdf61
chore(NA): merge and solve conflicts with main
mistic Oct 8, 2024
2274885
fix(NA: mute sass warnings again)
mistic Oct 8, 2024
58dce59
fix(NA): plugin helpers jest integration tests snapshots
mistic Oct 8, 2024
56d1e4c
fix(NA): revert sass-loader into v10
mistic Oct 8, 2024
9343245
chore(NA): disable usedExports on ui-shared-deps builds
mistic Oct 9, 2024
ee7a6f3
fix(NA): polyfill resolution on bundles
mistic Oct 9, 2024
0a23515
fix(NA): remove usedExports from ui-shared-deps
mistic Oct 9, 2024
3b1b646
chore(NA): add libs-browser-webpack-polyfill and mainFields,condition…
mistic Oct 9, 2024
9754a0b
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Oct 9, 2024
aaff027
fix(NA): remove avoid iife option from optimize
mistic Oct 9, 2024
67bfebc
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Oct 9, 2024
1568ef8
fix(NA): stop setting conditionNames
mistic Oct 9, 2024
ab6dacd
chore(NA): update resolutions on ui-shared-deps
mistic Oct 10, 2024
189f21c
chore(NA): clean unused code on webpack configs
mistic Oct 10, 2024
62fe582
fix(NA): eslint at packages/kbn-node-libs-browser-webpack-plugin/inde…
mistic Oct 10, 2024
7945db7
fix(NA): add same mainField resolution to worker webpack config
mistic Oct 10, 2024
54f1462
fix(NA): remove conditionNames from worker config
mistic Oct 10, 2024
1885557
fix(NA): being able to prioritize module on mainFields over main
mistic Oct 11, 2024
b92d24f
fix(NA): enable minimizer
mistic Oct 11, 2024
7ecf7f8
fix(NA): package.json format
mistic Oct 11, 2024
0c5bd37
chore(NA): merge and solve conflicts with main
mistic Oct 11, 2024
5f31562
chore(NA): remove openssl_legacy_provider from webpack configs
mistic Oct 11, 2024
ef358cc
fix(NA): eslint at packages/kbn-test/src/jest/resolver.js
mistic Oct 11, 2024
d0365da
chore(NA): remove remaining NODE_OPTIONS=--openssl-legacy-provider
mistic Oct 11, 2024
659b050
chore(NA): add webpack group into renovate
mistic Oct 11, 2024
a3d75fe
fix(NA): minimumReleaseAge to 30days for webpack group
mistic Oct 11, 2024
73c4d08
fix(NA): snapshot for packages/kbn-plugin-helpers/src/integration_tes…
mistic Oct 11, 2024
96185f7
chore(NA): try not to use not: raw
mistic Oct 12, 2024
62b7cf9
feat(NA): introduce bundle_remote_used_exports_plugin so we can enabl…
mistic Oct 16, 2024
a7aaf40
fix(NA): eslint fix at packages/kbn-optimizer/src/worker/bundle_remot…
mistic Oct 16, 2024
96baf16
chore(NA): experiment without changes in bundle_remote_module.ts
mistic Oct 16, 2024
2c0ba78
fix(NA): update limits for dataViewManagement
mistic Oct 16, 2024
f9f2032
fix(NA): update limits for dataViewManagement v2
mistic Oct 16, 2024
0ace116
chore(NA): merge and solve conflicts with main
mistic Oct 16, 2024
4a87043
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Oct 16, 2024
76c03ab
fix(NA): kbn-cloud-security-posture/graph/storybook
mistic Oct 16, 2024
9eee747
feat(NA): introduce new pickMaxWorkerCount function in the optimizer …
mistic Oct 16, 2024
5295f69
fix(NA): eslint for src/dev/storybook/aliases.ts
mistic Oct 16, 2024
28f3498
Merge branch 'main' into upgrade-to-webpack-5
mistic Oct 17, 2024
0f98aea
fix(NA): new pickMaxWorkerCount function at packages/kbn-optimizer/sr…
mistic Oct 17, 2024
a72f3f8
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Oct 17, 2024
ef538b8
chore(NA): rebuild yarn.lock based on upstream head
mistic Oct 17, 2024
7abf2aa
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 17, 2024
65ac89d
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Oct 17, 2024
ca6803b
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Oct 17, 2024
d6a880e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Oct 17, 2024
6d8e2e9
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Oct 17, 2024
2c27ea6
fix(NA): remove extra missing place still using --openssl-legacy-prov…
mistic Oct 18, 2024
f37dd35
chore(NA): removes domain browser resolution for now
mistic Oct 21, 2024
a2324b7
chore(NA): merge and solve conflicts with main
mistic Oct 21, 2024
b467c8a
chore(NA): merge and solve conflicts with main
mistic Oct 23, 2024
e6c4092
fix(NA): remove wrong @emotion/react/dist cjs import
mistic Oct 23, 2024
bb15f9c
chore(NA): merge and solve conflicts with main
mistic Oct 24, 2024
dd51d22
chore(NA): remove console polyfill
mistic Oct 24, 2024
b572b1f
fix(NA): canvas shareable_runtime webpack config
mistic Oct 24, 2024
3a1d7c7
fix(NA): correctly build caches on worker/populate_bundle_cache_plugi…
mistic Oct 26, 2024
a69a8c2
chore(NA): merge and solve conflicts with main
mistic Oct 27, 2024
438fdce
fix(NA): storybook aliases for cloud_security_posture_packages
mistic Oct 28, 2024
8ca271e
fix(NA): quick checks
mistic Oct 28, 2024
c8a4e20
fix(NA): correctly account concatenatedModules in moduleCount
mistic Oct 29, 2024
315d70d
chore(NA): merge and solve conflicts with main
mistic Oct 30, 2024
a786dc9
fix(NA): removes @xyflow/react alias from webpack configs
mistic Oct 30, 2024
f3cd2f3
fix(NA): remove unused fallbacks on kbn-monaco
mistic Oct 30, 2024
9a1f46c
chore(NA): increase webpack update frequency on renovate to 60 days
mistic Oct 30, 2024
b9ab6b7
fix(NA): revert for now the alias for xyflow
mistic Oct 30, 2024
7df71f3
fix(NA): revert xyflow alias from webpack config
mistic Oct 31, 2024
3f7fe44
chore(NA): merge and solve conflicts with main
mistic Nov 4, 2024
0c250de
fix(NA): remove raw-loader
mistic Nov 4, 2024
70a79e8
chore(NA): merge and solve conflicts with main
mistic Nov 4, 2024
fc724a8
chore(NA): merge and solve conflicts with main
mistic Nov 6, 2024
b46617f
chore(NA): merge and solve conflicts with main
mistic Nov 6, 2024
4741b66
chore(NA): merge and solve conflicts with main
mistic Nov 13, 2024
bd5c005
chore(NA): increase limit for aiops
mistic Nov 13, 2024
82d2107
Merge branch 'main' into upgrade-to-webpack-5
mistic Nov 13, 2024
f58ea75
chore(NA): merge and solve conflits with main
mistic Nov 20, 2024
8fd9e71
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 20, 2024
35c9a30
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 20, 2024
93fdeb7
chore(NA): update limits
mistic Nov 20, 2024
de32b85
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Nov 20, 2024
8cf48ac
Merge branch 'main' into upgrade-to-webpack-5
mistic Nov 20, 2024
802f3d1
chore(NA): adjust docs for watchers
mistic Nov 20, 2024
0bb35cd
fix(NA): remove memory based constraints from maxWorkers calculations
mistic Nov 20, 2024
4ae1f2b
refact(NA): remove old calc function
mistic Nov 20, 2024
fc2e15d
Merge branch 'main' into upgrade-to-webpack-5
mistic Nov 21, 2024
2f0fb7c
Merge branch 'main' into upgrade-to-webpack-5
mistic Nov 23, 2024
8f7c2b5
chore(NA): merge and solve conflicts with main
mistic Dec 2, 2024
afe2a5c
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Dec 2, 2024
6229e3a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 2, 2024
8e2d6d8
fix(NA): build failures
mistic Dec 3, 2024
34c09cd
chore(NA): merge and solve conflicts with main and mute sass warnings
mistic Dec 4, 2024
5c259b9
fix(NA): types for peggy-loader
mistic Dec 4, 2024
ee23614
fix(NA): bazel build
mistic Dec 4, 2024
a086432
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Dec 4, 2024
4b95752
fix(NA): typecheck
mistic Dec 4, 2024
e9398de
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Dec 4, 2024
4ab41e1
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Dec 4, 2024
0539bfe
chore(NA): merge and solve conflicts with main
mistic Dec 13, 2024
9b10cb5
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Dec 13, 2024
5c4e461
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 13, 2024
81eca4e
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Dec 14, 2024
993fd09
fix(NA): types and lock file
mistic Dec 14, 2024
5ad7baf
Merge branch 'upgrade-to-webpack-5' of github.com:mistic/kibana into …
mistic Dec 14, 2024
10e255f
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Dec 14, 2024
f66e1e8
fix(NA): correctly cache @elastic/eui/optimize/es/services/theme/warn…
mistic Dec 14, 2024
8ff6dba
fix(NA): update aiops limits
mistic Dec 15, 2024
af7263d
Merge branch 'main' into upgrade-to-webpack-5
mistic Dec 16, 2024
0ed6f7a
Revert "fix(NA): correctly cache @elastic/eui/optimize/es/services/th…
mistic Dec 18, 2024
5efdda1
chore(NA): merge and solve conflicts with main
mistic Dec 18, 2024
9a8755a
Merge remote-tracking branch 'upstream/main' into upgrade-to-webpack-5
mistic Dec 23, 2024
d7084ec
fix(NA): test uncomment eui provider dev warning
mistic Dec 24, 2024
34e36e7
Revert "fix(NA): test uncomment eui provider dev warning"
mistic Dec 24, 2024
7fe73d7
fix(NA): storybook build
mistic Dec 24, 2024
e8f6ecc
chore(NA): upgrade aiops limits
mistic Dec 29, 2024
0d9916f
Revert "Revert "fix(NA): correctly cache @elastic/eui/optimize/es/ser…
mistic Dec 29, 2024
09ac9af
fix(NA): linting at .buildkite/scripts/steps/storybooks/build_and_upl…
mistic Dec 29, 2024
3ade4d0
chore(NA): merge and solve conflicts with upstream
mistic Jan 3, 2025
5ed066d
fix(NA): typescript error on discover storybook
mistic Jan 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- command: .buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh
label: 'Build Webpack Bundle Analyzer reports'
agents:
machineType: n2-standard-4
machineType: n2-standard-8
preemptible: true
key: webpack_bundle_analyzer
timeout_in_minutes: 60
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/functional/profiling_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ echo "--- Profiling Cypress Tests"

cd "$XPACK_DIR"

NODE_OPTIONS=--openssl-legacy-provider node solutions/observability/plugins/profiling/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
node solutions/observability/plugins/profiling/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
6 changes: 5 additions & 1 deletion .buildkite/scripts/steps/storybooks/build_and_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ const build = () => {
console.log('--- Building Storybooks');

for (const storybook of Object.keys(storybookAliases)) {
exec(`STORYBOOK_BASE_URL=${STORYBOOK_BASE_URL}`, `yarn storybook --site ${storybook}`);
exec(
`STORYBOOK_BASE_URL=${STORYBOOK_BASE_URL}`,
`NODE_OPTIONS=--max-old-space-size=6144`,
`yarn storybook --site ${storybook}`
);
}
};

Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ packages/kbn-manifest @elastic/kibana-core
packages/kbn-mock-idp-plugin @elastic/kibana-security
packages/kbn-mock-idp-utils @elastic/kibana-security
packages/kbn-monaco @elastic/appex-sharedux
packages/kbn-node-libs-browser-webpack-plugin @elastic/kibana-operations
packages/kbn-object-versioning @elastic/appex-sharedux
packages/kbn-object-versioning-utils @elastic/appex-sharedux
packages/kbn-openapi-bundler @elastic/security-detection-rule-management
Expand Down
2 changes: 1 addition & 1 deletion examples/embeddable_examples/public/app/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React from 'react';
import { css } from '@emotion/react';
import { EuiMarkdownFormat } from '@elastic/eui';
// @ts-ignore
import overviewMarkdown from '!!raw-loader!@kbn/embeddable-plugin/README.md';
import overviewMarkdown from '@kbn/embeddable-plugin/README.md?raw';

export const Overview = () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import React from 'react';
import { EuiCodeBlock, EuiSpacer, EuiText } from '@elastic/eui';
// @ts-ignore
import registerSearchEmbeddableSource from '!!raw-loader!../react_embeddables/search/register_search_embeddable';
import registerSearchEmbeddableSource from '../react_embeddables/search/register_search_embeddable?raw';
// @ts-ignore
import registerAttachActionSource from '!!raw-loader!../react_embeddables/search/register_add_search_panel_action';
import registerAttachActionSource from '../react_embeddables/search/register_add_search_panel_action?raw';
// @ts-ignore
import registerFieldListEmbeddableSource from '!!raw-loader!../react_embeddables/field_list/register_field_list_embeddable';
import registerFieldListEmbeddableSource from '../react_embeddables/field_list/register_field_list_embeddable?raw';
// @ts-ignore
import registerReactEmbeddableSavedObjectSource from '!!raw-loader!../react_embeddables/register_saved_object_example';
import registerReactEmbeddableSavedObjectSource from '../react_embeddables/register_saved_object_example?raw';

export const RegisterEmbeddable = () => {
return (
Expand Down
10 changes: 5 additions & 5 deletions examples/field_formats_example/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import * as example1 from './examples/1_using_existing_format';
import * as example2 from './examples/2_creating_custom_formatter';
// @ts-ignore
import example1SampleCode from '!!raw-loader!./examples/1_using_existing_format';
import example1SampleCode from './examples/1_using_existing_format?raw';
// @ts-ignore
import example2SampleCodePart1 from '!!raw-loader!../common/example_currency_format';
import example2SampleCodePart1 from '../common/example_currency_format?raw';
// @ts-ignore
import example2SampleCodePart2 from '!!raw-loader!./examples/2_creating_custom_formatter';
import example2SampleCodePart2 from './examples/2_creating_custom_formatter?raw';
// @ts-ignore
import example2SampleCodePart3 from '!!raw-loader!../server/examples/2_creating_custom_formatter';
import example2SampleCodePart3 from '../server/examples/2_creating_custom_formatter?raw';
// @ts-ignore
import example3SampleCode from '!!raw-loader!./examples/3_creating_custom_format_editor';
import example3SampleCode from './examples/3_creating_custom_format_editor?raw';

export interface Deps {
fieldFormats: FieldFormatsStart;
Expand Down
59 changes: 28 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"serverless-security": "node scripts/kibana --dev --serverless=security",
"spec_to_console": "node scripts/spec_to_console",
"start": "node scripts/kibana --dev",
"storybook": "node --openssl-legacy-provider scripts/storybook",
"storybook": "node --no-deprecation scripts/storybook",
"test:ftr": "node scripts/functional_tests",
"test:ftr:runner": "node scripts/functional_test_runner",
"test:ftr:server": "node scripts/functional_tests_server",
Expand Down Expand Up @@ -689,6 +689,7 @@
"@kbn/newsfeed-plugin": "link:src/plugins/newsfeed",
"@kbn/newsfeed-test-plugin": "link:test/common/plugins/newsfeed",
"@kbn/no-data-page-plugin": "link:src/platform/plugins/private/no_data_page",
"@kbn/node-libs-browser-webpack-plugin": "link:packages/kbn-node-libs-browser-webpack-plugin",
"@kbn/notifications-plugin": "link:x-pack/platform/plugins/shared/notifications",
"@kbn/object-versioning": "link:packages/kbn-object-versioning",
"@kbn/object-versioning-utils": "link:packages/kbn-object-versioning-utils",
Expand Down Expand Up @@ -1337,7 +1338,6 @@
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-transform-class-properties": "^7.24.7",
"@babel/plugin-transform-logical-assignment-operators": "^7.24.7",
"@babel/plugin-transform-numeric-separator": "^7.24.7",
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/plugin-transform-runtime": "^7.24.7",
Expand All @@ -1351,7 +1351,7 @@
"@bazel/typescript": "4.6.2",
"@cypress/debugging-proxy": "2.0.1",
"@cypress/grep": "^4.0.1",
"@cypress/webpack-preprocessor": "^6.0.1",
"@cypress/webpack-preprocessor": "^6.0.2",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/makelogs": "^6.1.1",
"@elastic/synthetics": "^1.12.1",
Expand Down Expand Up @@ -1540,11 +1540,13 @@
"@storybook/addon-storyshots": "^6.5.16",
"@storybook/addons": "^6.5.16",
"@storybook/api": "^6.5.16",
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/client-api": "^6.5.16",
"@storybook/components": "^6.5.16",
"@storybook/core": "^6.5.16",
"@storybook/core-common": "^6.5.16",
"@storybook/core-events": "^6.5.16",
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/node-logger": "^6.5.16",
"@storybook/preview-web": "^6.5.16",
"@storybook/react": "^6.5.16",
Expand Down Expand Up @@ -1675,11 +1677,10 @@
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^3.0.2",
"@types/watchpack": "^1.1.5",
"@types/webpack": "^4.41.3",
"@types/webpack": "^5.28.5",
"@types/webpack-bundle-analyzer": "^4.7.0",
"@types/webpack-env": "^1.15.3",
"@types/webpack-merge": "^4.1.5",
"@types/webpack-sources": "^0.1.4",
"@types/webpack-env": "^1.18.5",
"@types/webpack-sources": "^3.2.3",
"@types/xml2js": "^0.4.11",
"@types/yargs": "^15.0.0",
"@types/yauzl": "^2.9.1",
Expand All @@ -1694,12 +1695,13 @@
"autoprefixer": "^10.4.7",
"axe-core": "^4.10.0",
"babel-jest": "^29.7.0",
"babel-loader": "^8.2.5",
"babel-loader": "^9.1.3",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-require-context-hook": "^1.0.0",
"babel-plugin-styled-components": "^2.1.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-plugin-transform-require-default": "^0.1.7",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"backport": "^8.9.8",
"blob-polyfill": "^7.0.20220408",
Expand All @@ -1708,12 +1710,12 @@
"chance": "1.0.18",
"chromedriver": "^131.0.1",
"clarify": "^2.2.0",
"clean-webpack-plugin": "^3.0.0",
"clean-webpack-plugin": "^4.0.0",
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.1",
"content-security-policy-parser": "^0.6.0",
"cpy": "^8.1.1",
"css-loader": "^3.4.2",
"css-loader": "^7.1.2",
"cssnano": "^5.1.12",
"cssnano-preset-default": "^5.2.12",
"cssstyle": "^4.1.0",
Expand Down Expand Up @@ -1752,18 +1754,17 @@
"eslint-traverse": "^1.0.0",
"exit-hook": "^2.2.0",
"expect": "^29.7.0",
"expose-loader": "^0.7.5",
"expose-loader": "^5.0.0",
"express": "^4.21.2",
"fetch-mock": "^7.3.9",
"file-loader": "^4.2.0",
"find-cypress-specs": "^1.41.4",
"form-data": "^4.0.0",
"geckodriver": "^5.0.0",
"gulp-brotli": "^3.0.0",
"gulp-postcss": "^9.0.1",
"gulp-terser": "^2.1.0",
"has-ansi": "^3.0.0",
"html-loader": "^1.3.2",
"html-loader": "^5.1.0",
"http-proxy": "^1.18.1",
"http2-proxy": "^5.0.53",
"http2-wrapper": "^2.2.1",
Expand All @@ -1787,10 +1788,9 @@
"license-checker": "^25.0.1",
"listr2": "^8.2.5",
"lmdb": "^2.9.2",
"loader-utils": "^2.0.4",
"marge": "^1.0.1",
"micromatch": "^4.0.8",
"mini-css-extract-plugin": "1.1.0",
"mini-css-extract-plugin": "2.9.1",
"minimist": "^1.2.6",
"mocha": "^10.3.0",
"mocha-junit-reporter": "^2.0.2",
Expand All @@ -1803,7 +1803,7 @@
"mutation-observer": "^1.0.3",
"native-hdr-histogram": "^1.0.0",
"nock": "12.0.3",
"null-loader": "^3.0.0",
"node-libs-browser": "^2.2.1",
"nyc": "^17.1.0",
"oboe": "^2.1.7",
"openapi-types": "^12.1.3",
Expand All @@ -1817,28 +1817,27 @@
"playwright-chromium": "1.49.0",
"pngjs": "^7.0.0",
"postcss": "^8.4.31",
"postcss-loader": "^4.2.0",
"postcss-loader": "^8.1.1",
"postcss-prefix-selector": "^1.16.0",
"postcss-scss": "^4.0.4",
"prettier": "^2.8.8",
"proxy": "^2.1.1",
"raw-loader": "^3.1.0",
"react-is": "^17.0.2",
"react-test-renderer": "^17.0.2",
"recast": "^0.23.9",
"regenerate": "^1.4.0",
"resolve": "^1.22.0",
"rxjs-marbles": "^7.0.1",
"sass-embedded": "^1.78.0",
"sass-loader": "^10.5.1",
"sass-loader": "^10.5.2",
"selenium-webdriver": "^4.27.0",
"sharp": "0.32.6",
"simple-git": "^3.16.0",
"sinon": "^7.4.2",
"sort-package-json": "^1.53.1",
"source-map": "^0.7.4",
"string-replace-loader": "^2.2.0",
"style-loader": "^1.1.3",
"string-replace-loader": "^3.1.0",
"style-loader": "^4.0.0",
"stylelint": "^14.9.1",
"stylelint-scss": "^4.3.0",
"superagent": "^10.1.1",
Expand All @@ -1849,25 +1848,23 @@
"table": "^6.8.2",
"tape": "^5.9.0",
"terser": "^5.36.0",
"terser-webpack-plugin": "^4.2.3",
"terser-webpack-plugin": "^5.3.10",
"tough-cookie": "^5.0.0",
"trace": "^3.2.0",
"tree-kill": "^1.2.2",
"ts-morph": "^15.1.0",
"tsd": "^0.31.1",
"typescript": "5.1.6",
"url-loader": "^2.2.0",
"val-loader": "^1.1.1",
"val-loader": "^6.0.0",
"vinyl-fs": "^4.0.0",
"watchpack": "^1.6.0",
"web-streams-polyfill": "^4.0.0",
"webpack": "^4.41.5",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-merge": "^4.2.2",
"webpack-sources": "^1.4.1",
"webpack-visualizer-plugin2": "^1.1.0",
"webpack": "^5.95.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"webpack-merge": "^6.0.1",
"webpack-sources": "^3.2.3",
"xml-crypto": "^6.0.0",
"xmlbuilder": "15.1.1",
"yargs": "^15.4.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { BehaviorSubject } from 'rxjs';

jest.mock('!!raw-loader!./disable_animations.css', () => 'MOCK DISABLE ANIMATIONS CSS');
jest.mock('./disable_animations.css?raw', () => 'MOCK DISABLE ANIMATIONS CSS');

import { StylesService } from './styles_service';
import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Subscription } from 'rxjs';
import type { CoreService } from '@kbn/core-base-browser-internal';
import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser';
// @ts-expect-error
import disableAnimationsCss from '!!raw-loader!./disable_animations.css';
import disableAnimationsCss from './disable_animations.css?raw';

interface StartDeps {
uiSettings: IUiSettingsClient;
Expand Down
12 changes: 12 additions & 0 deletions packages/kbn-ambient-ui-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@ declare module '*.mdx' {
// eslint-disable-next-line import/no-default-export
export default MDXComponent;
}

declare module '*?asUrl' {
const content: string;
// eslint-disable-next-line import/no-default-export
export default string;
}

declare module '*?raw' {
const content: string;
// eslint-disable-next-line import/no-default-export
export default string;
}
1 change: 1 addition & 0 deletions packages/kbn-babel-preset/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUNTIME_DEPS = [
"@npm//babel-plugin-styled-components",
"@npm//babel-plugin-transform-react-remove-prop-types",
"@npm//babel-plugin-transform-typescript-metadata",
"@npm//babel-plugin-transform-require-default",
]

js_library(
Expand Down
19 changes: 18 additions & 1 deletion packages/kbn-babel-preset/webpack_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
const { USES_STYLED_COMPONENTS } = require('./styled_components_files');

/** @type {import('@babel/core').ConfigFunction} */
module.exports = (api, options = {}) => {
module.exports = (
api,
options = {
useTransformRequireDefault: false,
}
) => {
return {
presets: [
[
Expand All @@ -27,6 +32,18 @@ module.exports = (api, options = {}) => {
],
[require('./common_preset'), options],
],
plugins: [
// Conditionally include babel-plugin-transform-require-default
//
// We need to include this plugin in the main worker webpack config that handles our
// non node modules code base in order to support resolving esm
// as a priority over cjs (if that's defined in the mainFields). Without that we might run into
// cases where we have a repo wide cjs code that requires an esm module (coming from the ui-shared-deps that also prioritizes esm)
// which will not be applying the .default key in the require itself.
...(options.useTransformRequireDefault
? [require.resolve('babel-plugin-transform-require-default')]
: []),
],
env: {
production: {
plugins: [
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-cypress-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { v4 as uuid } from 'uuid';
import { defineConfig } from 'cypress';
import wp from '@cypress/webpack-preprocessor';
import { NodeLibsBrowserPlugin } from '@kbn/node-libs-browser-webpack-plugin';

export function defineCypressConfig(options?: Cypress.ConfigOptions<any>) {
return defineConfig({
Expand Down Expand Up @@ -43,6 +44,7 @@ export function defineCypressConfig(options?: Cypress.ConfigOptions<any>) {
},
],
},
plugins: [new NodeLibsBrowserPlugin()],
},
})(file);
});
Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-cypress-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
"exclude": [
"target/**/*"
],
"kbn_references": []
"kbn_references": [
"@kbn/node-libs-browser-webpack-plugin",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export const NoBoundaryCrossingRule: Rule.RuleModule = {
return visitAllImportStatements((req, { node, importer, type }) => {
if (
req === null ||
// we can ignore imports using the raw-loader, they will need to be resolved but can be managed on a case by case basis
req.startsWith('!!raw-loader') ||
// we can ignore imports using the ?raw (replacing legacy raw-loader), they will need to be resolved but can be managed on a case by case basis
req.endsWith('?raw') ||
// type only imports can stretch across all the boundaries
isTypeOnlyImport(importer)
) {
Expand Down
Loading