Commit Graph

157 Commits

Author SHA1 Message Date
ismail simsek
37e4353a18
Chore: Fix running frontend unit tests in JetBrains (#93441)
read the files with their absolute paths
2024-09-18 17:51:58 +02:00
Ryan McKinley
427dad26a2
Swagger: Add a custom swagger/api page (#91785)
Co-authored-by: Kristian Bremberg <kristian.bremberg@grafana.com>
2024-08-14 09:03:00 +03:00
Tom Ratcliffe
8136fbef1f
Chore: Add capability for overriding local development behaviour using env vars (#85603) 2024-08-13 13:07:42 +01:00
Joao Silva
dbb64b3ff0
Icons: Cache Bookmark icons (#91332) 2024-08-01 17:27:44 +01:00
Sergej-Vlasov
8f99d58aaf
WebpackDev: Resolve react-router-dom from local node modules (#89547)
resolve react-router-dom from local node modules
2024-07-04 13:28:54 +03:00
Ashley Harrison
47f8717149
React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
Andrej Ocenas
5f326e98c1
NodeGraph: Add msagl and the layered layout code (#88375) 2024-05-28 17:04:03 +02:00
Andrej Ocenas
20294b0fb6
NodeGraph: Remove msagl lib and layered layout option (#87905)
* Remove msagl lib

* Change drone.yml

* update signature
2024-05-20 13:50:08 +02:00
Jack Westbrook
6599fa805d
Plugins: Always load decoupled frontend assets from builds (#81873)
* Wip

* Wip

* Adapt to load external module

* build: remove cloudmonitoring from built_in_plugins, clean up webpack output

* chore(plugins): remove decoupled plugins from package.json deps

* chore(codeowners): update file for nx.json

* revert(webpack): put back path in config

* build(frontend): use nx to run prod builds of decoupled plugins with yarn build

* style(prometheus): run prettier-write to fix tsconfig.json

* style(backend): remove unused subFile.isDistDir

* revert(locales): remove formatting changes adding new line at end of files

* chore(webpack): clean up dev output

* build(nx): make grafana an nx project, bump lerna and nx

* build(plugin-configs): move cache directory to node_modules

* style(datasource-plugins): add eslint ignore for .gen.ts files

* chore(codeowners): add frontend-ops as owner of project.json

* build(webpack): add getDecoupledPlugins to automatically ignore when watching

* ci(drone): skip nx cache when building frontend packages

* style(ci): fix missing trailing comma

* Revert "style(ci): fix missing trailing comma"

This reverts commit 7520d41576.

* Revert "ci(drone): skip nx cache when building frontend packages"

This reverts commit 46938883ac.

* feat(zipkin): remove from grafana core bundle

* chore(npm): bump nx package to latest 18.0.8

* docs(dev-guide): add a note about what yarn start now builds

---------

Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
2024-03-13 12:40:09 +01:00
renovate[bot]
ad80518db0
Update dependency webpack-dev-server to v5 (#83258)
* Update dependency webpack-dev-server to v5

* update webpack.hot config (is this even used anymore?)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2024-02-23 11:43:16 +02:00
Jack Westbrook
0dcdfc261b
Monaco Editor: Load via ESM (#78261)
* chore(monaco): bump monaco-editor to latest version

* feat(codeeditor): use esm to load monaco editor

* revert(monaco): put back previous version

* feat(monaco): setup MonacoEnvironment when bootstrapping app

* feat(monaco): load monaco languages from registry as workers

* feat(webpack): clean up warnings, remove need to copy monaco into lib

* fix(plugins): wip - remove amd loader workaround in systemjs hooks

* chore(azure): clean up so QueryField passes typecheck

* test(jest): update config to fix failing tests due to missing monaco-editor

* test(jest): update config to work with monaco-editor and kusto

* test(jest): prevent message eventlistener in nodeGraph/layout.worker tripping up monaco tests

* test(plugins): wip - remove amd related tests from systemjs hooks

* test(alerting): prefer clearAllMocks to prevent monaco editor failing due to missing matchMedia

* test(parca): fix failing test due to undefined backendSrv

* chore: move monacoEnv to app/core

* test: increase testing-lib timeout to 2secs, fix parca test to assert dom element

* feat(plugins): share kusto via systemjs

* test(e2e): increase timeout for checking monaco editor in exemplars spec

* test(e2e): assert monaco has loaded by checking the spinner is gone and window.monaco exists

* test(e2e): check for monaco editor textarea

* test(e2e): check monaco editor is loaded before assertions

* test(e2e): add waitForMonacoToLoad util to reduce duplication

* test(e2e): fix failing mysql spec

* chore(jest): add comment to setupTests explaining need to incresae default timeout

* chore(nodegraph): improve comment in layout.worker.utils to better explain the need for file
2024-02-22 12:31:40 +01:00
Josh Hunt
57993f65ed
Chore: webpack alias react and grafana-runtime to share singletons (#81789)
* Chore: webpack alias react and grafana-runtime to share singletons

* Move alias to dev webpack, add alias for grafana-data as well

* remove whitespace
2024-02-05 16:25:19 +00:00
Andrej Ocenas
cb945aa5df
NodeGraph: Use layered layout instead of force based layout (#78957) 2024-01-31 17:26:12 +01:00
Jack Westbrook
6d582858f7
Webpack: Allow watching workspaces (#81569)
* build(webpack): remove symlinks:false to enable watching packages with yarn start

* build(webpack): add resolve node_modules for enterprise to resolve packages

* add comment

---------

Co-authored-by: joshhunt <josh@trtr.co>
2024-01-30 16:59:18 +01:00
Josh Hunt
8f0ae76afe
Chore: Use yarn node-modules linker (#79947)
* Chore: Use yarn node-modules linker

* fix react-router types resolution

* temp skip failing tests

* remove yarn-links for internal path aliases to fix some webpack errors

* transpile all .ts files, even those in node_modules (usually our internal workspace packages

* fix transformers mock

* import react router type directly

* remove old resolution

* more cleanup

* remove preserveSymlinks: true from tsconfig to make Go To Definition resolve grafana ui to the original location

* developer guide

* update dev guide

* remove sdks

* reenable tests

* fix tsconfig trailing commas (where did they come from)
2024-01-29 14:27:35 +00:00
Torkel Ödegaard
ed128ea964
Frontend: Foundations for multi tenant frontend (#78815)
* Frontend: Foundations for multi tenant frontend

* improve manifest parsing for multi-tenant frontend (#78876)

* add test

* add test

* ??

* Updates

* Added cache

* test cleanup

* lint

* fix test

* fix error templates

* cleanup

* remove copy

* revert changes to list testdata

* comment cleanup

* prepare integration tests

* Remove integrety

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-05 08:34:22 +01:00
Josh Hunt
4ad7aed096
Chore: Remove eval source maps to fix trusted types during dev (#72664)
* user essentials mob! 🔱

lastFile:scripts/webpack/webpack.dev.js

* user essentials mob! 🔱

* delete results.md

Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com>
Co-authored-by: tskarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Roxana Turc <anamaria-roxana.turc@grafana.com>

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com>
Co-authored-by: tskarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Roxana Turc <anamaria-roxana.turc@grafana.com>
2023-08-02 07:35:36 +00:00
Jack Westbrook
00f0ff038e
Chore: Introduce yarn start:noLint (#64430)
chore(webpack): introduce start:noLint to bypass typecheck and lint plugins during dev
2023-08-01 11:58:39 +02:00
Dominik Prokop
61459e2b96
Bump scenes to 0.17.2 (#70893)
* Bump scenes to 0.17.2

* Update jest config

* Update tsconfig

* Update webpack config

* Update to latest API
2023-07-05 07:24:48 -07:00
Esteban Beltran
ed5a697825
Plugins: Sandbox frontend plugins DOM access. (#69246) 2023-06-21 14:49:22 +02:00
Andreas Christou
a6484c6f81
Azure: Fix Kusto auto-completion for Azure datasources (#69685)
* Fix Kusto auto-completion not working in HG

* Add update to script paths

* Update CODEOWNERS

* Missed the ts
2023-06-07 11:49:43 +01:00
Josh Hunt
b65ce6738f
Chore: Change dev sourcemaps to work around firefox warning (#67929)
Change dev sourcemaps to work around firefox warning
2023-06-05 09:51:48 +00:00
renovate[bot]
1fbff3c807
Update dependency esbuild to v0.17.19 (#61522)
* Update dependency esbuild to v0.17.18

* chore(npm): update all esbuild dependencies to use esbuild@0.17.18

* build(esbuild): update configs so esbuild-loader matches loader from file extension

* build(webpack): fix failed monaco editor loading due to require not existing

* chore(esbuild): bump to 0.17.19

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2023-06-01 10:23:09 +02:00
Esteban Beltran
362936b002
Build: Force same version of @emotion/react via webpack config (#66822) 2023-04-24 17:13:52 +02:00
Ashley Harrison
0c0d63b830
Build: enable caching in eslint plugin (#64325)
enable caching in eslint plugin
2023-03-07 14:53:50 +00:00
Jack Westbrook
3a7623753b
Build: Replace babel-loader with esbuild-loader (#57837)
* build(webpack): replace babel-loader with esbuild-loader

* build(webpack): add esbuild minifier to production builds

* Wip

* Removed ngInject and replaced with manual inject params

* chore: bump esbuild to 0.15.13

* Fixed angular issues

* build(frontend): update esbuild to 0.16.16

* chore(webpack): support browserslist for esbuild

* build(esbuild): unify versions of esbuild to 0.16.17 and esbuild-loader to 2.21.0

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-01-23 12:15:05 +01:00
Jack Westbrook
5ea01dc9b9
Build: Introduce webpack manifest plugin (#49798)
* build(webpack): introduce manifest plugin

* build(webpack): move manifest.json to root of project and git ignore
2022-08-30 05:18:55 -04:00
Esteban Beltran
112f69177b
Build: Replace the file-loader loader with asset module in webpack config (#53088) 2022-08-04 10:29:42 +02:00
Jack Westbrook
78bef7a26a
Build: Enable long term caching for frontend assets (#47625)
* build(webpack): move CopyUniconsPlugin into own file

* chore(webpack): delete unused blobUrl and compile loaders

* build(webpack): prefer contenthash over fullhash for longer caching

* build(webpack): set optimization.moduleIds named only in dev

* build(webpack): introduce HTMLWebpackCSSChunks so templates can access theme css by name

* feat: inject css files with contenthash in html templates

* revert(error-template): remove ContentDeliveryURL from CSS href

* refactor(index-template): update grafanaBootData.themePaths

* chore(webpack): add typescript annotations for CopyUniconsPlugin
2022-05-26 11:49:18 +02:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
Ashley Harrison
5f67d78219
Use bookmark icon for Saved Items, add support for solid bookmark icon (#46775)
* Use bookmark icon for Saved Items, add support for solid bookmark icon

* Add some unit tests

* Refactor utils into own file

* Update test title

* Fix import

* consistent function style
2022-03-21 13:01:43 +00:00
Josh Hunt
3b497f3e8d
Chore: Move babel config to a root babel.config.json (#41615)
* Chore: Move babel config to a root babel.config.json

* Re-add babel cache settings to webpack

* Re-add production browserlist in babel config

* re-add babel hot refresh config

* fix storybook
2021-11-18 16:38:58 +00:00
Jack Westbrook
5fad5511e9
Build: Enable persistent cache for faster Webpack builds (#41430)
* build(webpack): enable caching for development and production builds

* build(webpack): introduce unminified production build script

* build(typescript): introduce incremental flag to cache typechecking

* chore(git): ignore typescript cache file

* chore(webpack): bump dependencies to latest
2021-11-11 14:32:34 +01:00
Artur Wierzbicki
f45eb309ef
Live: move centrifuge service to a web worker (#41090)
* Fix: make webpack pickup workers written in TS

* Add comlink to dependencies

* Temporary fix: copy paste `toDataQueryError` from @grafana/runtime to avoid web dependencies

* Implemented comlink-based centrifuge worker & worker proxy

* Temporary fix: implement comlink transferHandlers for subscriptions and streamingdataframes

* Move liveTimer filtering from CentrifugeService into GrafanaLiveService

* Switch from CentrifugeService to CentrifugeServiceWorkerProxy in GrafanaLive

* Naming fix

* Refactor: move liveTimer-based data filtering from GrafanaLiveService to CentrifugeServiceWorker

* observe dataStream on an async scheduler

* Fix: - Unsubscribe is now propagated from the main thread to the worker, - improve worker&workerProxy types

* Fix: Prettify types

* Fix: Add error & complete observers

* Docs: Add comment explaining the `subscriberTransferHandler`

* Fix: Replace `StreamingDataFrameHandler` with explicitly converting StreamingDataFrame to a DataFrameDTO

* Refactor: move liveTimer filtering to service.ts to make it easy to implement a `live-service-web-worker` feature flag

* Feat: add `live-service-web-worker` feature flag

* Fix: extract toDataQueryError.ts to a separate file within `@grafana-runtime` to avoid having a dependency from webworker to the whole package (@grafana-runtime/index.ts)

* Update public/app/features/dashboard/dashgrid/liveTimer.ts

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>

* Fix: fixed default import class in worker file

* Fix: cast worker as Endpoint

* Migrate from worker-loader to webpack native worker support v1 - broken prod build

* Fix: Use custom path in HtmlWebpackPlugin

* Fix: Loading workers from CDNs

* Fix: Avoid issues with jest ESM support by mocking `createWorker` files

* Fix: move the custom mockWorker rendering layout to `test/mocks`

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-11-09 21:05:01 +04:00
kay delaney
209122347c
Chore: Fix broken enterprise builds (#41025) 2021-10-28 10:51:12 +01:00
kay delaney
3a7c5a0755
Chore: Switch yarn 2 to plug-n-play strategy (#40300) 2021-10-27 14:21:07 +01:00
Domas
5267ea35ea
alias react-hook-form in webpack config (#40284) 2021-10-11 15:24:03 +02:00
kay delaney
b2e94d0733
Chore: Migrate yarn from v1 to v2 (#39082)
* Chore: Migrate yarn from v1 to v2

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-10-08 15:19:10 +01:00
Ashley Harrison
e2c87caff0
Chore: Remove postcss-browser-reporter (#39409) 2021-09-20 13:38:23 +02:00
Ryan McKinley
ddd110d0b2
Geomap: include sample geojson files (#39057) 2021-09-10 09:05:03 -07:00
Zoltán Bedi
7e6cf14c84
Fix: Include Buffer in webpack build (#38819) 2021-09-02 14:18:07 +02:00
Ole Kristian (Zee)
92934af741
Monaco: Add javascript and typescript support (#38703) 2021-09-01 08:55:01 -07:00
Jack Westbrook
8d3b31ff23
Build: Upgrade Webpack 5 (#36444)
* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* revert(webpack): remove include from babel-loader so symlinks (enterprise) work as before

* refactor(webpack): fix deprecation warnings in prod builds

* fix(storybook): fix failing builds due to replacing css-optimise webpack plugin

* fix(storybook): use raw-loader for svg icons

* build(webpack): fix dev script colors error

* chore(webpack): bump css-loader and react-refresh-webpack-plugin to latest versions

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-31 12:55:05 +02:00
Jack Westbrook
d1da97b176
Bump babel to 7.14.x for typescript 4.3 support (#36465)
* chore(babel): bump packages to 7.14.x

* chore(babel): remove plugin-proposal-class-properties and plugin-proposal-private-methods

these plugins are now enabled by default in preset-env
2021-07-07 10:43:17 +02:00
Josh Hunt
fcb4e5a211
Grafana-UI: Remove references to old monaco libraries (#35557) 2021-06-22 11:52:08 +01:00
Andrej Ocenas
cb4f5b249f
NodeGraph: Make web worker inline fixing error when assets are loaded with different origin (#35013) 2021-06-01 09:56:28 +02:00
Andrej Ocenas
fdd6620d0a
NodeGraph: Exploration mode (#33623)
* Add exploration option to node layout

* Add hidden node count

* Add grid layout option

* Fix panning bounds calculation

* Add legend with sorting

* Allow sorting on any stats or arc value

* Fix merge

* Make sorting better

* Reset focused node on layout change

* Refactor limit hook a bit

* Disable selected layout button

* Don't show markers if only 1 node is hidden

* Move legend to the bottom

* Fix text backgrounds

* Add show in graph layout action in grid layout

* Center view on the focused node, fix perf issue when expanding big graph

* Limit the node counting

* Comment and linting fixes

* Bit of code cleanup and comments

* Add state for computing layout

* Prevent computing map with partial data

* Add rollup plugin for worker

* Add rollup plugin for worker

* Enhance data from worker

* Fix perf issues with reduce and object creation

* Improve comment

* Fix tests

* Css fixes

* Remove worker plugin

* Add comments

* Fix test

* Add test for exploration

* Add test switching to grid layout

* Apply suggestions from code review

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Remove unused plugin

* Fix function name

* Remove unused rollup plugin

* Review fixes

* Fix context menu shown on layout change

* Make buttons bigger

* Moved NodeGraph to core grafana

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-05-12 16:04:21 +02:00
Josh Hunt
72c9d806fd
AzureMonitor: Kusto language support (#33528)
* Add Kusto custom language to Monaco

* Load Kusto schema into monaco

* cleanup + tests

* cleanup + tests

* cleanup :)

* move monaco languages to a registry
2021-05-11 16:48:59 +02:00
Josh Hunt
a13c5380a7
Grafana-UI: Switch CodeEditor to UMD @monao-editor/react (#33204)
* Grafana-UI: Switch CodeEditor to @monao-editor/react

* update copy script and paths

* hide context menu

* use __grafana_public_path__

* Fix value and language not updating

* update jaeger tsconfig

* update tsconfig

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-04-27 17:34:56 +01:00
Leon Sorokin
ed3f5e6ca3
Build: drop TS checking from yarn build (#33235) 2021-04-21 14:40:51 -05:00