Skip to content

Commit

Permalink
fix: add REACT_18 env variable to kbn-plugin-helpers bazel config (#2…
Browse files Browse the repository at this point in the history
…11121)

## Summary

Adds `REACT_18` to `kbn-plugin-helpers` bazel config, this fixes an
issue when trying to create plugins using the automatic plugin
generator. For context see
#210917 (comment)

Related user report: [Custom Plugin
Error](https://discuss.elastic.co/t/custom-plugin-error/366589)

Before fix:

![image](https://github.com/user-attachments/assets/e7e9e524-719e-4fdb-8598-050ec9f2f036)

After fix:

![image](https://github.com/user-attachments/assets/63d69d1a-bfc8-4be6-83a0-1c567be4d101)

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Jon <jon@elastic.co>
(cherry picked from commit 9a6a349)
  • Loading branch information
rlueder committed Feb 18, 2025
1 parent 82bf169 commit b89ef4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kbn-plugin-helpers/src/tasks/bazel_packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { TaskContext } from '../task_context';
export async function buildBazelPackages({ log, dist }: TaskContext) {
log.info('run bazel and build required artifacts for the optimizer');

const args = [`--define=REACT_18=${Boolean(process.env.REACT_18)}`];
if (dist) args.push('--define=dist=true');
try {
await runBazel(
[
Expand All @@ -21,7 +23,7 @@ export async function buildBazelPackages({ log, dist }: TaskContext) {
'//src/platform/packages/private/kbn-ui-shared-deps-src:shared_built_assets',
'//src/platform/packages/shared/kbn-monaco:target_workers',
'--show_result=1',
].concat(dist ? [`--define=dist=true`] : []),
].concat(args),
{
logPrefix: ' │ ',
quiet: true,
Expand Down

0 comments on commit b89ef4b

Please sign in to comment.