-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Do not serve legacy JS when serving a Kibana Platform application #61011
Conversation
window.location.assign( | ||
this.http.basePath.prepend('/app/kibana#/error/action.auto_create_index') | ||
); |
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.
TODO: test this case
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.
🙈 on this if (isAutoCreateIndexError(error)) {
block, but we need to keep the TODO
to at least adapt the redirecting url when the page is migrated from legacy.
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.
is there a test for this?
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.
We can remove the auto create index error handling code and views. Probably out of scope for this PR, so I created #63894
Pinging @elastic/kibana-platform (Team:Platform) |
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.
Approach looks good to me. Now, is it working 😄 ?
window.location.assign( | ||
this.http.basePath.prepend('/app/kibana#/error/action.auto_create_index') | ||
); |
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.
🙈 on this if (isAutoCreateIndexError(error)) {
block, but we need to keep the TODO
to at least adapt the redirecting url when the page is migrated from legacy.
80fe38d
to
3f17e0a
Compare
98c767e
to
77c47ef
Compare
@joshdover is this ready for review? |
I'm planning to add a more tests for the The other to do is to create a dedicated core bundle that is separate from the core entry point so that more code sharing can be leveraged with the plugin and legacy bundles. However, this can be done in a future PR. |
77c47ef
to
ef11745
Compare
@cchaos I actually decided to rollback these SCSS changes. I was originally trying to avoid loading some legacy CSS but it turns out there's more there we need right now and cleaning that up feels out of scope for this PR. For now we will continue to load most of the legacy CSS (still excluding legacy plugin-specific CSS) so that everything still works. We can focus on this more deliberately in #58369. |
Got it thanks 👍. It would be great if we could eventually have some guidelines around how SASS/CSS is compiled in some form of documentation like the CONTRIBUTING doc. I think this is the most misunderstood part of writing plugins. We have "How to write SASS", but not how to import it into the file system. |
@cchaos Scratch that, it was necessary to move. I addressed all of your comments and pushed again with those CSS changes. |
@@ -162,7 +162,7 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) { | |||
], | |||
}, | |||
{ | |||
test: /\.scss$/, | |||
test: /\.(scss|css)$/, |
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.
We shouldn't be passing css to the sass-loader, should we? If the file should be parsed as sass I think we should change the extension to scss and not automatically parse it as scss.
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.
Ah yes, I added this in my first POC iterations and forgot to remove.
: `${basePath}/${path.publicPath}` | ||
) | ||
.reverse(), | ||
...(isCore |
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.
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.
Since the order of CSS files affects the rendered styles, I decided to preserve the current ordering. I think we want to make sure that DLL styles are loaded first so that all subsequent sheets can override them.
It's just too hard to accidentally break things with CSS so I'm erring on the side caution here.
'{{regularBundlePath}}/kbn-ui-shared-deps/{{sharedJsFilename}}', | ||
'{{dllBundlePath}}/vendors_runtime.bundle.dll.js', | ||
{{#each dllJsChunks}} | ||
{{#each jsDependencies}} |
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 diff
@@ -23,7 +23,7 @@ import { BundleCache } from './bundle_cache'; | |||
import { UnknownVals } from './ts_helpers'; | |||
import { includes, ascending, entriesToObject } from './array_helpers'; | |||
|
|||
const VALID_BUNDLE_TYPES = ['plugin' as const]; | |||
const VALID_BUNDLE_TYPES = ['plugin' as const, 'entry' as const]; |
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.
The inclusion of plugins in those bundles has caused a number of issues over the years and it seems there needs not be a whole "platform" loaded to render those two pages.
Not sure it's feasible. That would add a limitation that security plugin cannot use other plugins API (licensing, for example) on login
/ logout
pages. Also, it's already working with bootstrapping all the KP plugins.
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 for making those SASS changes!
|
||
// Mixins provide generic code expansion through helpers | ||
@import '@elastic/eui/src/global_styling/mixins/index'; | ||
// This file is built by both the legacy and KP build systems so we need to |
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 for this comment!
implement `includeCoreBundle: boolean` config
packages/kbn-optimizer/src/__fixtures__/mock_repo/src/core/public/entry_point.ts
Outdated
Show resolved
Hide resolved
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.
Optimizer side of things LGTM
@flash1293 would you mind taking a look at the graph changes? I removed an unused scss import and added a manual import for angular-route that was inadvertently imported by core before. |
@elasticmachine merge upstream |
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.
Tested Graph changes in Chrome and everything works as expected, LGTM 👍 I will take care of inlining the wrapper styles in a separate PR.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Summary
Fixes #60580
Fixes #58327
src/core/public
@kbn/optimizer
To do
Page load time improvements
Here are some stats on a production build comparing this branch to the latest snapshot from master.
Checklist
Delete any items that are not applicable to this PR.
For maintainers