Skip to content

feat: dynamically update type declarations#202

Merged
ZuperZee merged 1 commit intomainfrom
zuperzee/dynamically-update-type-declarations
Jun 6, 2025
Merged

feat: dynamically update type declarations#202
ZuperZee merged 1 commit intomainfrom
zuperzee/dynamically-update-type-declarations

Conversation

@ZuperZee
Copy link
Copy Markdown
Contributor

@ZuperZee ZuperZee commented Jun 6, 2025

The customProperties/codeData type declarations in onInit and onRender are now dynamically updated based on the json data written in the customProperties section.
This only works for Grafana v8.2.0-v8.3.X and v9.2.0 and later. Grafana v8.4.0 updated monaco editor to v0.31.1 which had a bug which prevents dynamically updating type declarations. This was fixed in Grafana v9.2.0.

image

image

Closes #116

The customProperties/codeData type declarations are now
dynamically updated based on the json data written in
the customProperties section.
This only works for Grafana v8.2.0-v8.3.X and v9.2.0 and later.
Grafana v8.4.0 updated monaco editor to v0.31.1 which had a bug
which prevents dynamically updating type declarations.
This was fixed in Grafana v9.2.0.
@ZuperZee ZuperZee merged commit 16aacd1 into main Jun 6, 2025
5 checks passed
@ZuperZee ZuperZee deleted the zuperzee/dynamically-update-type-declarations branch June 6, 2025 07:54
ZuperZee added a commit that referenced this pull request Jun 6, 2025
Start loading the editor immediately instead of waiting for the
type declarations to be fetched.
The editor can still be used when the declarations are not yet
loaded, but the type declarations are loaded pretty quick,
so it shouldn't be noticeable.

This has kinda the same problems as #202 since this uses
dynamic updating of type declarations.
Straight copied from the commit message:
This only works for Grafana v8.2.0-v8.3.X and v9.2.0 and later.
Grafana v8.4.0 updated monaco editor to v0.31.1 which had a bug
which prevents dynamically updating type declarations.
This was fixed in Grafana v9.2.0.
ZuperZee added a commit that referenced this pull request Jun 10, 2025
Start loading the editor immediately instead of waiting for the
type declarations to be fetched.
The editor can still be used when the declarations are not yet
loaded, but the type declarations are loaded pretty quick,
so it shouldn't be noticeable.

This has kinda the same problems as #202 since this uses
dynamic updating of type declarations.
Straight copied from the commit message:
This only works for Grafana v8.2.0-v8.3.X and v9.2.0 and later.
Grafana v8.4.0 updated monaco editor to v0.31.1 which had a bug
which prevents dynamically updating type declarations.
This was fixed in Grafana v9.2.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamically update the codeData/customProperties type in onInit/onRender code

1 participant