tsc is already invoked during the CI compile step, where it checks type.
For the tsc invocation to work, we need to build the Rust module first, which slows down the fmt_lint_typecheck CI job.
Typedoc complains about the links from the reference to the cover.md.
I couldn't find a way to make those warnings go away, but the links work.
As a remedy, `treatWarningsAsErrors` is removed temporarily.
Similarly, the relative links aren't supported either, so link to the latest
Slint docs.
Fixes#6488
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.
Fixes#1332
```
error: unexpected `cfg` condition value: `noop`
--> api/node/rust/lib.rs:17:1
|
17 | #[napi]
| ^^^^^^^
|
= note: expected values for `feature` are: `accessibility`, `backend-linuxkms`, `backend-linuxkms-noseat`, `backend-qt`, `backend-winit`, `backend-winit-wayland`, `backend-winit-x11`, `default`, `renderer-femtovg`, `renderer-skia`, `renderer-skia-opengl`, `renderer-skia-vulkan`, `renderer-software`, and `testing`
= help: consider adding `noop` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `-D unexpected-cfgs` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
= note: this error originates in the attribute macro `napi` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `cfg` condition value: `used_linker`
--> api/node/rust/lib.rs:17:1
|
17 | #[napi]
| ^^^^^^^
|
= note: expected values for `feature` are: `accessibility`, `backend-linuxkms`, `backend-linuxkms-noseat`, `backend-qt`, `backend-winit`, `backend-winit-wayland`, `backend-winit-x11`, `default`, `renderer-femtovg`, `renderer-skia`, `renderer-skia-opengl`, `renderer-skia-vulkan`, `renderer-software`, and `testing`
= help: consider adding `used_linker` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: this error originates in the attribute macro `napi::bindgen_prelude::ctor` (in Nightly builds, run with -Z macro-backtrace for more info)a
...
```
This would appear also when running `pnpm install` globally. If there's diagnostic output to be generated for this situation, it needs to go elsewhere.
Continue to run build-on-demand.mjs to permit a fallback to a
from-source build for users who run `npm install slint-ui` on a platform
where we don't provide binaries for (such as linux-armv7/64). However,
this is only done when run from the installed package, not from git.
From git, the prestart trick remains in use.
This makes copying such types much cheaper and will allow us to
intern common struct types in the future too. This further
drops the sample cost for langtype.rs from ~6.6% down to 4.0%.
We are now also able to share/intern common struct types.
Before:
```
Time (mean ± σ): 1.073 s ± 0.021 s [User: 0.759 s, System: 0.215 s]
Range (min … max): 1.034 s … 1.105 s 10 runs
allocations: 3074261
```
After:
```
Time (mean ± σ): 1.034 s ± 0.026 s [User: 0.733 s, System: 0.201 s]
Range (min … max): 1.000 s … 1.078 s 10 runs
allocations: 2917476
```
This allows us to cheaply copy the langtype::Type values which
contain such a type. The runtime impact is small and barely noticable
but a sampling profiler shows a clear reduction in samples pointing
at langtype.rs, roughly reducing that from ~8.6% inclusive cost
down to 6.6% inclusive cost.
Furthermore, this allows us to share/intern common types.
Before:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 1.089 s ± 0.026 s [User: 0.771 s, System: 0.216 s]
Range (min … max): 1.046 s … 1.130 s 10 runs
allocations: 3152149
```
After:
```
Time (mean ± σ): 1.073 s ± 0.021 s [User: 0.759 s, System: 0.215 s]
Range (min … max): 1.034 s … 1.105 s 10 runs
allocations: 3074261
```
This removes a lot of allocations and speeds up the compiler step
a bit. Sadly, this patch is very invasive as it touches a lot of
files. That said, each individual hunk is pretty trivial.
For a non-trivial real-world example, the impact is significant,
we get rid of ~29% of all allocations and improve the runtime by
about 4.8% (measured until the viewer loop would start).
Before:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 664.2 ms ± 6.7 ms [User: 589.2 ms, System: 74.0 ms]
Range (min … max): 659.0 ms … 682.4 ms 10 runs
allocations: 4886888
temporary allocations: 857508
```
After:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 639.5 ms ± 17.8 ms [User: 556.9 ms, System: 76.2 ms]
Range (min … max): 621.4 ms … 666.5 ms 10 runs
allocations: 3544318
temporary allocations: 495685
```
Replaces the use of NPM with PNPM. This should make it quick and easy to update any of the dependencies as dependabot will now see everything in one go.
As a drive-by, this introduces a macro that allows for explicit logging to console.error (which goes to stderr). This is something we should gradually start using, as it allows for capturing on the Node.js side (by the user or our tests).
Puts a shared biome.json in the root.
Deletes the prettier config files.
Deletes the unused pre-commit hooks.
Applies biome linting and formatting to the slintpad project.
* Use vscode ext lint and format also for api/node
* Re-use biome config file from VS code instead of duplicating it
* Remove package-lock.json again
* Don't bother running the biome formatter on Windows
---------
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>