Skip to content

[storybook] Add static path to @kbn/monaco web workers#225383

Merged
clintandrewhall merged 5 commits intoelastic:mainfrom
clintandrewhall:fix/175196
Jul 1, 2025
Merged

[storybook] Add static path to @kbn/monaco web workers#225383
clintandrewhall merged 5 commits intoelastic:mainfrom
clintandrewhall:fix/175196

Conversation

@clintandrewhall
Copy link
Contributor

@clintandrewhall clintandrewhall commented Jun 26, 2025

Summary

Fixes #175196

The built web workers for @kbn/monaco were not available to the Storybook instance. This PR fixes that by mapping a static directory to the built bazel-bin workers directory.

Testing

  1. Load [storybook url]?path=/story/code-editor-code-editor--json-support.
  2. Type "ver and look for an autocomplete.

Screenshot 2025-06-25 at 8 54 40 PM

  • Tested locally with yarn storybook shared_ux
  • Tested the site build:
    • Run yarn storybook shared_ux --site
    • Run npx serve built_assets/storybook/shared_ux

@clintandrewhall clintandrewhall requested a review from a team as a code owner June 26, 2025 00:55
@clintandrewhall clintandrewhall added review loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. backport:skip This PR does not require backporting Feature:Storybook Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// ci:build-storybooks v9.1.0 labels Jun 26, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@clintandrewhall clintandrewhall requested a review from eokoneyo June 26, 2025 00:55
to: 'plugins/kibanaReact/assets',
},
{
from: `${REPO_ROOT}/bazel-bin/src/platform/packages/shared/kbn-monaco/target_workers`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is a PR and a plan to remove Bazel, I don't know if this is the best approach, and we should wait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How close are we to finishing that work? The PR has been open for quite some time, and has (and will continue to have) merge conflicts. I'd just as soon merge this so we know we need to fix it with moon... the PR has changes to @kbn/monaco, so it might make sense to have the fix in that PR, as well?

@eokoneyo has more context as to the value of this story, and it's his issue. If we wait, we should update the bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other shared deps packages are using Bazel as well, so I don't think it's much of an issue since the others will need updating.

Copy link
Contributor

@Ikuni17 Ikuni17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not getting autocomplete when using the preview built by CI, and there are many web worker errors (not entirely sure if they are related though)

image

@clintandrewhall
Copy link
Contributor Author

I'm not getting autocomplete when using the preview built by CI, and there are many web worker errors (not entirely sure if they are related though)

Thanks, I may have broken something with my last "tweak". I'll take a look.

@eokoneyo
Copy link
Contributor

@elasticmachine merge upstream

@eokoneyo
Copy link
Contributor

I'm not getting autocomplete when using the preview built by CI, and there are many web worker errors (not entirely sure if they are related though)

Thanks, I may have broken something with my last "tweak". I'll take a look.

I made a slight adjustment, and the issue with loading the worker in the build preview has been resolved

@eokoneyo
Copy link
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@eokoneyo eokoneyo requested a review from Ikuni17 June 30, 2025 16:32
@clintandrewhall clintandrewhall merged commit fd6470f into elastic:main Jul 1, 2025
11 checks passed
@clintandrewhall clintandrewhall deleted the fix/175196 branch July 1, 2025 02:11
@kibanamachine kibanamachine mentioned this pull request Aug 7, 2025
11 tasks
@delanni delanni added backport:version Backport to applied version labels v9.1.1 and removed backport:skip This PR does not require backporting v9.1.0 labels Aug 7, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16803994229

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16803994083

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 7, 2025
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 7, 2025
#230976)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[storybook] Add static path to @kbn/monaco web workers
(#225383)](#225383)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Clint Andrew
Hall","email":"clint.hall@elastic.co"},"sourceCommit":{"committedDate":"2025-07-01T02:11:57Z","message":"[storybook]
Add static path to @kbn/monaco web workers
(#225383)","sha":"fd6470f6d01b83d6cb809e88e6bd5ae5080d44b0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["review","loe:small","release_note:skip","impact:low","Feature:Storybook","Team:SharedUX","ci:build-storybooks","backport:version","v9.2.0","v9.1.1"],"title":"[storybook]
Add static path to @kbn/monaco web
workers","number":225383,"url":"https://github.com/elastic/kibana/pull/225383","mergeCommit":{"message":"[storybook]
Add static path to @kbn/monaco web workers
(#225383)","sha":"fd6470f6d01b83d6cb809e88e6bd5ae5080d44b0"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225383","number":225383,"mergeCommit":{"message":"[storybook]
Add static path to @kbn/monaco web workers
(#225383)","sha":"fd6470f6d01b83d6cb809e88e6bd5ae5080d44b0"}},{"branch":"9.1","label":"v9.1.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
@mistic mistic added v9.1.2 and removed v9.1.1 labels Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:build-storybooks Feature:Storybook impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes review Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code editor stories are faulty

8 participants