-
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
Read coreApp assets directly from package #144492
Merged
TinaHeiligers
merged 15 commits into
elastic:main
from
TinaHeiligers:kbn-read-core-app-assets-from-package
Nov 4, 2022
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
72d225c
Moves assets to root of package, update bazel build file to extract a…
TinaHeiligers 6ccc2a8
Updates dev build tasks and precommit hook
TinaHeiligers 58dfd1a
Removes duplicate subset of assets from core
TinaHeiligers 70a15ca
Updates path to legacy_light_theme css in canvas shareable_runtime
TinaHeiligers e15b8b2
exports path to assets from core-app package, updates security prompt…
TinaHeiligers 2faf6e6
Updates jest unit test snapshots to account for new location of core …
TinaHeiligers 67023d0
restores prompt_page
TinaHeiligers c862640
restores snapshots from reverted cahnges in prompt_page
TinaHeiligers 4b0f296
Moves ReplaceFavicon task to after BuilBazelPackages
TinaHeiligers c8e9380
Servers assets directly from node modules after the package is built
TinaHeiligers 3274c9b
Updates registerStaticDirs to read from built-location of assets
TinaHeiligers d0213c3
Removes unused exported constants
TinaHeiligers 09c99c2
Merge branch 'main' into kbn-read-core-app-assets-from-package
kibanamachine 9471f5c
Merge branch 'main' into kbn-read-core-app-assets-from-package
kibanamachine 803eccc
Merge branch 'main' into kbn-read-core-app-assets-from-package
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
* Side Public License, v 1. | ||
*/ | ||
|
||
import Path from 'path'; | ||
import { stringify } from 'querystring'; | ||
import { Env } from '@kbn/config'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
@@ -202,8 +201,13 @@ export class CoreAppsService { | |
}); | ||
} | ||
|
||
// After the package is built and bootstrap extracts files to bazel-bin, | ||
// assets are exposed at the root of the package and in the package's node_modules dir | ||
private registerStaticDirs(core: InternalCoreSetup | InternalCorePreboot) { | ||
core.http.registerStaticDir('/ui/{path*}', Path.resolve(__dirname, './assets')); | ||
core.http.registerStaticDir( | ||
'/ui/{path*}', | ||
fromRoot('node_modules/@kbn/core-apps-server-internal/assets') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to load these assets from their location post-build. |
||
); | ||
|
||
core.http.registerStaticDir( | ||
'/node_modules/@kbn/ui-framework/dist/{path*}', | ||
|
Binary file not shown.
Binary file not shown.
4 changes: 0 additions & 4 deletions
4
src/core/server/core_app/assets/favicons/favicon.distribution.svg
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So, what does that do exactly?
But I think I spotted the problem:
This PR moved the assets from
{package}/src/assets
to{package}/assets
. However you did not change the path in the route registered to serve them:kibana/packages/core/apps/core-apps-server-internal/src/core_app.ts
Lines 205 to 206 in 0ba81e1
Changing the
Path.resolve(__dirname, './assets')
to target the correct folder should hopefully do the trick.