Commit graph

25 commits

Author SHA1 Message Date
Marta Bondyra
65bdf1ff8e
Optimize existing image assets with lossless compression (#223998)
## Summary

This PR applies **lossless compression** to all SVG and JPG/PNG assets
across Kibana using:

- [`svgo`](https://github.com/svg/svgo) — for optimizing SVGs  
- [`image-optimize`](https://www.npmjs.com/package/image-optimize) — for
JPG/PNG compression

‼️**Please scroll to ''Unknown metric groups" accordion to see what's
the gain for your code.**
<img width="542" alt="Screenshot 2025-06-18 at 13 24 20"
src="https://github.com/user-attachments/assets/191afb28-44fc-4551-9026-756a8385c66a"
/>

The goal is to reduce asset size and improve load performance without
compromising visual quality.

This PR achieves a **23 MB** reduction in asset size across all images
bundled in Kibana’s running code—meaning these compressed images
directly impact what ships in Kibana.
Some assets get bundled into chunks due to our bundling strategy but
might not actually be requested at runtime.

Additionally, I ran the same optimization script on the docs assets as a
harmless extra step, but those savings aren’t included in the 23 MB
total.

---

## Why

While working on Emotion rewrites, I noticed some SVGs seemed
unnecessarily heavy. That led to a broader investigation into our image
assets, and it turns out we’re not consistently optimizing them during
development or build.


---

## Notes

- Visual fidelity of optimized assets has been manually verified — no
visible differences
- The optimization is **lossless**, meaning no quality degradation
- Some assets (like large background images) could benefit further from
**lossy compression**

---

## Follow-ups / Ideas

1. **Automate compression in the dev/build pipeline**
   - e.g. add `svgo` as a pre-commit or CI step for SVGs
2. **Improve CI reporting**  
- Currently, bundle size diffs for images are hidden under "Unknown
metric groups" in the GitHub CI comment. We may want to make these more
visible.
   - 
3. **Audit large assets manually** — apply lossy compression where
appropriate
4. **Avoid redundant image loading**  
- e.g. background images on the login page are loaded again on the space
selector page since they’re bundled twice. I’m working on a separate PR
to address that.

## Snippets I used to apply the compression

```
# Find SVG files
find . -type f -iname "*.svg" \
  -not -path "*/node_modules/*" \
  -not -path "*/functional/*" > svg-files.txt

# Compress SVGs
while IFS= read -r file; do
  svgo "$file"
done < svg-files.txt
```

This snippet has been used for png and jpg, but the example below is for
png:
```
# Find PNG files
find . -type f -iname "*.png \
  -not -path "*/node_modules/*" \
  -not -path "*/functional/*" > png-files.txt

# Compress PNGs
while IFS= read -r file; do
  image-optimize -f jpg "$file"
done < png-files.txt
```
2025-06-19 16:44:13 +02:00
Ola Pawlus
9ef486f4eb
Update hello_world_plugin.mdx (#222562)
Update hello_world_plugin - plugin.tsx file
2025-06-04 16:40:21 +02:00
Kirill Chernakov
7550229ed0
[Docs] fix image paths in hello-world plugin guide (#222379) 2025-06-03 21:44:11 +04:00
Kirill Chernakov
5a82e1fd95
[Docs] Getting Started guide — hello world plugin (#222139)
## Before

There are two links in
[CONTRIBUTING.md](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md),
one for elastic employees and another for [external
contributors](https://www.elastic.co/docs/extend/kibana). ["Getting
Started"](https://docs.elastic.dev/kibana-dev-docs/getting-started/hello-world-app)
in internal is a bit outdated (e.g., it mentions old kibana.json instead
of .jsonc). Therefore, when developer starts kibana after adding plugin
he won't see it because bootstrap script looks for kibana.jsonc.

## After

- Code blocks updated to create `kibana.jsonc` in latest format,
formatted in respective languages.
- Screenshots updated.
- Note about plugin generator being outdated.

<img width="671" alt="Screenshot 2025-06-01 at 16 47 13"
src="https://github.com/user-attachments/assets/1cf0a63d-f9f7-4b80-b4df-e6fe7210c76f"
/>

<img width="685" alt="Screenshot 2025-06-01 at 16 49 17"
src="https://github.com/user-attachments/assets/9279c124-d44c-4657-88fa-963bca8566bf"
/>
2025-06-03 11:24:15 +04:00
Gerard Soldevila
fb26c1c683
SKA: Update broken references and URLs (#206836)
## Summary

Updates a number of broken file references and broken links.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2025-01-28 03:32:48 +00:00
Brad White
35231e9d37
Remove references to old type check script (#202825)
## Summary

Remove references to `scripts/build_ts_refs` which doesn't exist anymore

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
2024-12-18 11:38:30 -08:00
Charlotte Alexandra Wilson
2b60d6f481
Update hello_world_plugin.mdx (#197104)
## Summary

Changed import path for Kibana Core Public imports, previous was not
working. New import path reflects what I found elsewhere in the
codebase, and works.
2024-10-22 15:58:06 +01:00
Brad White
4a53ce9e5c
Fix dev container repo path, add limitations docs (#193488)
## Summary

- Fixes an issue where the container would not be setup or start
properly if the repo wasn't name `kibana`
- Adds limitations section to docs
2024-09-19 15:07:18 -07:00
Brad White
4710b0d84a
[Docs] Clarify .env for Dev Container (#192142)
## Summary

Adds a bit of clarification on where the dev container env configuration
is located.
2024-09-04 16:52:03 -07:00
Brad White
d07ffe2a04
Add Kibana Dev Container (#188887)
## Summary
- Closes elastic/kibana-operations#101

This PR adds a [Dev Container](https://containers.dev/) to utilize for
Kibana local development in an isolated environment. The original
intention was to create a local environment for FIPS development because
setting up Kibana in FIPS mode is complicated and has the potential to
break the user's OS. However, it has been altered to allow for general
development if an engineer chooses as well. The idea is for this be a
cost efficient replacement for
[kibana-remote-dev](https://github.com/elastic/kibana-remote-dev)
eventually.

### Testing
- In VS Code you should be able to use the `Dev Containers: Clone GitHub
Pull Request in Named Container Volume...` command from the Command
Palette (F1) to easily test this PR.
- See the
[docs](bd125fc230/dev_docs/getting_started/setting_up_a_development_env.mdx (using-the-kibana-dev-container-optional))
for additional information on setting up the Dev Container.


### Bazel
I tried many different solutions to copy the local Bazel cache into the
container to speed up bootstrap, but it either would break Bazel or
didn't provide any meaningful boost in performance. I opted to forgo
keeping it in this PR due to the complexity and since we're planning to
phase out Bazel in the future anyways.
2024-08-26 14:38:45 -07:00
Alex Szabo
85e0c8e360
docs(kibana): fix md syntax, first dev login details (#158168)
Fixing very minor issues in the Kibana dev docs that I found as I was
getting bootstrapped:
 - fixing bad markdown syntax
 - adding first startup info (url + credentials)
2023-05-23 17:33:35 +02:00
Spencer
6c438b331c
[api-docs] follow the correct schema for frontmatter (#138348)
* [api-docs] follow the correct schema for frontmatter

* rename non-generated summary: usage

* fix yaml comment syntax
2022-08-10 17:17:50 -05:00
Tiago Costa
7cc4eaee28
docs(NA): drop windows native development support (#135964)
* docs(NA): drop support for windows native development

* docs(NA): improve previous written instructions around windows de

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-21 14:37:18 +01:00
Cleydyr Bezerra de Albuquerque
44cf61577f
add clarification about what versions of Yarn are compatible with the project (#136325)
* docs: add clarification about what versions of Yarn are compatible with the project

* docs: rephrase

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>

* docs: rephrase

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>

Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
2022-07-21 00:44:58 +09:30
Tiago Costa
1599cd8d2a
docs(NA): windows wsl development (#134589)
* docs(NA): windows wsl development

* docs(NA): update titles for the documentation created

* chore(NA): update dev_docs/tutorials/development_windows.mdx

Co-authored-by: Jonathan Budzenski <jon@budzenski.me>

* docs(NA): updated guide to include info around GUI apps support

* docs(NA): updated guide to include info around GUI apps support

* docs(NA): include win10 GUI workaround

* docs(NA): run a first sudo command before running others

* docs(NA): added remote code wsl extension

* docs(NA): mentioned NVIDIA does now includes vGPU drivers for WSL within the common drivers

* docs(NA): update sudo commands separation

* docs(NA): added hardware virtualization prerequisite awareness into the guide

* docs(NA): update wording on guide recomendation for win11

Co-authored-by: Jonathan Budzenski <jon@budzenski.me>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-06-21 00:45:08 +01:00
Spencer
d7e6dc3c44
[docs] add troubleshooting docs about production react errors (#133682) 2022-06-06 18:11:33 -04:00
Stacey Gammon
1e3c90a40b
Update troubleshooting.mdx (#132475) 2022-05-18 14:15:00 -07:00
Beth Richardson
264c310503
Add owner to hello_world plugin tutorial manifest (#131263)
* Fix link to developer examples in dev env setup guide
2022-05-02 11:11:46 -05:00
Stacey Gammon
4a63ab9b3b
Clean up dev docs (#124271) 2022-02-03 10:09:10 -05:00
Jonathan Budzenski
eb9c8692aa
[dev docs] Add WSL setup guide (#109670)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-09 20:12:35 -05:00
Tyler Smalley
c4815d319e
Updates Github link references from master to main (#116789)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-29 09:53:08 -07:00
garanews
58f6d9002a
Fix typos in docs & dev_docs (#113746) 2021-10-07 14:30:32 -04:00
Stacey Gammon
eddbc8db6f
Update doc slugs to improve analytic tracking, move to appropriate folders (#113630)
* Update the slugs to improve google analytics drilldown tracking

* more slug updates

* Fix some formatting issues in building blocks

* update paths

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-04 13:36:45 -04:00
Stacey Gammon
21b080b61b
Clean up Developer Guide (#108259)
* update plugin docs

* address code review feedback
2021-08-12 14:05:43 -04:00
Stacey Gammon
2230c032c6
Add a new hello world plugin and adjust the welcome message. (#107789)
* Add a new hello world plugin and adjust the welcome message.

* update and move files

* Update CODEOWNERS

* add a tsconfig.json file

* update tsconfig.json

* fix type check

* address code review comments
2021-08-09 16:22:02 -04:00