-
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
Prefer third-party plugin development in ./plugins instead of ../kibana-extra #31748
Prefer third-party plugin development in ./plugins instead of ../kibana-extra #31748
Conversation
Pinging @elastic/kibana-platform |
I don't know the reason for this change but this feels like it could cause problems. Usually, a plugin will be in its own separate git repository and so you'll have a git repository (the plugin) inside of another git repository (kibana). |
💚 Build Succeeded |
@trevan The motivation for the change is that we want plugins to be able to reliably and consistently import static code from other plugins. Webpack aliases allow us to do this reliably on the client, but it's not consist since we can't use them on the server. Relative imports are a consistent way to do it, but they are only reliable if the relative location of plugins is similar between development and builds. The root plugins directory has its contents hidden from git, so you should be able to safely check out your plugin repo into that directory. |
@eliperelman Can you add a section to the PR description for |
@epixa, is it possible to symlink your plugin into the plugins directory for development? I tried that back in the 5.x days and there were some issues I had but maybe the later node/babel/webpack/etc can handle that now. |
That's a great question, and I don't know the answer. @eliperelman can you check that out? If it is possible, or if it's easy to make it possible, then we can say that the recommended workflow is to clone your plugin repo inside |
I have updated the tests here to ensure that plugins symlinked into |
@eliperelman, the issues I had dealt with importing code into the symlinked plugin. The file paths for importing didn't respect the symlink unless I had NODE_PRESERVE_SYMLINKS enabled and even then, there were weird issues. |
@epixa Interesting, I thought we were trying to explicitly avoid that in the New Platform and forcing plugins to expose the parts they intended to share. Did that change, or has my understanding just been wrong? |
💚 Build Succeeded |
@w33ble That is definitely still the desired route in the new platform, and I expect the static code sharing to be rare. But when it does need to happen, I don't want plugin authors to hack together a solution or be in a situation where some things work in oss but not in x-pack. |
@azasypkin I have updated the PR to programmatically create the symlink which should work on Windows in the future. |
💔 Build Failed |
💔 Build Failed |
retest |
💚 Build Succeeded |
@eliperelman Sorry for the churn here, but I've had a little bit of a change of heart and wanted to get your thoughts. I think we should update all the instructions as you did here and add the support for running in the Anyone developing in What do you think? |
Sure thing, I’ll see what I can do. |
8969b14
to
3acd6e1
Compare
@epixa I have revised, please let me know if you believe this is the correct direction based on your comments. Thanks! |
💔 Build Failed |
💚 Build Succeeded |
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.
This looks good overall, but when you make changes to kbn-pm
, you also must build a new distribution of it and commit that. It's the only package that requires this. See https://github.com/elastic/kibana/tree/master/packages/kbn-pm#development
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 on green
💔 Build Failed |
retest |
💔 Build Failed |
a8c5755
to
ca8b094
Compare
💔 Build Failed |
ca8b094
to
bff5527
Compare
💚 Build Succeeded |
…na-extra (elastic#31748) * Prefer third-party plugin development in plugins instead of kibana-extra * Fix failing recursive directory creation and removal * Add new built version of kbn-pm
Should starting Kibana from inside a plugin in the plugins directory be working? I'm getting the following error:
Also adding
Running |
Summary
This change switches preferred third-party plugin development from
../kibana-extra
, instead favoring theplugins
directory in the Kibana root. Relatedly this also renames the@kbn/pm
--skip-kibana-extra
to--skip-kibana-plugins
.Removing this directory and renaming the flag appear to be breaking changes, so I tagged this one as v8.0.0. Please revise if this is inaccurate.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportThis was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev-Docs
Prefer third-party plugin development in
plugins
instead ofkibana-extra
This change switches preferred third-party plugin development from
../kibana-extra
, instead favoring theplugins
directory in the Kibana root. By association,@kbn/pm
has the--skip-kibana-extra
flag renamed to--skip-kibana-plugins
.