-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[plugin-helpers] improve 3rd party KP plugin support #75019
[plugin-helpers] improve 3rd party KP plugin support #75019
Conversation
37b6ea0
to
b8e932d
Compare
b8e932d
to
f0c0768
Compare
…gin-helpers-kp-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…g on depth, avoid one level of yarn...
…nt the output if it fails
…gin-helpers-kp-support
💚 Build SucceededBuild metricsdistributable file count
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Tyler Smalley <tylersmalley@me.com> Co-authored-by: spalger <spalger@users.noreply.github.com> # Conflicts: # packages/kbn-plugin-helpers/package.json # x-pack/scripts/functional_tests.js # yarn.lock
…s-for-710 * 'master' of github.com:elastic/kibana: (43 commits) [APM] Chart units don't update when toggling the chart legends (elastic#74931) [ILM] Add support for frozen phase in UI (elastic#75968) Hides advanced json for count metric (elastic#74636) add client-side feature usage API (elastic#75486) [Maps] add drilldown support map embeddable (elastic#75598) [Enterprise Search] Request handler refactors/enhancements + update existing routes to use shared handler (elastic#76106) [Resolver] model `location.search` in redux (elastic#76140) [APM] Prevent imports of public in server code (elastic#75979) fix eslint issue skip flaky suite (elastic#76223) [APM] Transaction duration anomaly alerting integration (elastic#75719) [Transforms] Avoid using "Are you sure" (elastic#75932) [Security Solution][Exceptions] - Fix bug of alerts not updating after closure from exceptions modal (elastic#76145) [plugin-helpers] improve 3rd party KP plugin support (elastic#75019) [docs/getting-started] link to yarn v1 specifically (elastic#76169) [Security_Solution][Resolver] Resolver loading and error state (elastic#75600) Fixes App Search documentation links (elastic#76133) Fix alerts unable to create / update when the name has trailing whitepace(s) (elastic#76079) [Resolver] Fix useSelector usage (elastic#76129) [Enterprise Search] Migrate util and components from ent-search (elastic#76051) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/data_tier_allocation/node_allocation.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx # x-pack/plugins/index_lifecycle_management/public/application/services/policies/types.ts # x-pack/plugins/index_lifecycle_management/public/application/services/policies/warm_phase.ts
Hi @spalger, In this new implementation, is the plugin-helper able to build both old and new platform plugins? |
Nope, it's only able to build KP plugins because legacy plugin support is being removed for 7.10 so there's no point in overcomplicating the tool so that it understands both. Just trying to move forward and better support the tooling with KP support. |
OK, thanks for the answer. |
That's a mistake on my part. I'll have that post updated today. We originally estimated that this work would take longer and be a lower priority, hence the original 7.11 estimate. We decided to bump the priority of removing the legacy system for performance reasons and are now on track to remove legacy support 100% in 7.10. |
Nice to know ;) |
Just to confirm, is this now part of 7.10 release? |
@fastlorenzo yes. The legacy plugin system has been removed in 7.10 The docs about plugin migration to Kibana platform are going be published soon #82600 |
Not sure if a bug and if related to this change, but I can no longer access the public assets from the browser since migrating to 7.10.0 (cf. #83387 ) |
buffer: true, | ||
ignore: [ | ||
'**/*.d.ts', | ||
'**/public/**', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be causing the public/assets
not being copied to the build
folder (#83387 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that makes sense. Will get a PR up for 7.10.1 Monday.
You can probably either add the public/assets directory to the serverSourcePatterns
setting.
If you're only dealing with a couple files you could also just import the file using the file-loader, ie
import mbWorkerUrl from '!!file-loader!mapbox-gl/dist/mapbox-gl-csp-worker'; |
Nice find, sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to hear you know how to fix it 👍
I've tried adding public/**/*
, public/assets/**/*
, etc in serverSourcePatterns
, but nothing worked. My guess is that it's linked to the same issue.
I have a workaround for now: build the plugin with --skip-archive
, manually add the content of public/assets
to the build folder, and manually package the zip file.
Example with plugin named redelk
:
yarn build --skip-archive
mkdir build/kibana/redelk/public
cp -R public/assets/ build/kibana/redelk/public
cd build
zip redelk-7.10.0.zip kibana -r
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to share your workaround!
Closes #63069
Closes #70412
Closes #61731
This PR updates the plugin-helpers to be compatible with KP plugins instead of legacy plugins. It drastically refactors the code to both modernize it, improve it's type safety, and remove legacy cruft.
The
dev
andtest:server
tasks were removed, along with the old commander based interface. There is now a single command available from the plugin-helpers,build
.The old js API was also removed in favor of existing APIs from packages like
@kbn/dev-utils
.The
build
command creates distributable versions of plugins in a very similar way as it used to, except that those plugins now include akibana.json
file and have browser bundles which are created by the@kbn/optimizer
. Additionally, server code is pre-processed by babel allowing us to remove babel support from production completely.A docs PR will follow with a generation-to-distribution example of developing a 3rd party plugin.