napi would assert when we extract an object from a reference twice:
```
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/napi-2.13.3/src/js_values/value_ref.rs:59:5:
assertion `left == right` failed: Ref count is not equal to 0 while dropping Ref, potential memory leak
left: 1
right: 0
stack backtrace:
```
Fix this by avoiding the use of Ref.
... and use it to hide internal functionality so users will notice that
they depend on fucntionality we do not provide any guarantees for.
Make the lsp and viewer request the internal feature when building the
interpreter.
* Export interpreter stuff on private_api namespace
* Update api/napi/src/interpreter/value.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update tests/driver/napi/build.rs
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
* Update tests/driver/napi/Cargo.toml
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
* Avoid unwanted prompt on Windows when running npm run build twice
Don't generate "napi.js" as then Windows will try to open it when running just "napi",
if nodejs registered .js as extension.
* Remove windows path workaround
It doesn't look like that it is needed.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
and their related name.
Also move the component module in the item_Tree module
register_component -> register_item_tree
ComponentItemTree -> ItemTreeNodeArray
For #3323
Rationale from that issue:
Right now, we use the term `component` in the Slint language and in the compiler to be a a tree of elements that can be used as an element in a .slint file.
The term is also currently used in the runtime as a tree of runtime Items that are allocated together. (declared in ComponentVTable)
But there are no 1 to 1 mapping between a `component` in the slint language, and a runtime Component.
(for example, the items behind a `if` or `for` or `PopupMenu` are in a different runtime component. And `component` declared in Slint are often inlined)
So we should rename the internal runtime `Component` to `ItemTree`
The currently public `slint::ComponentHandle` wraps the "root" of the ItemTree, but that's ok because it is generated from a .slint `component`, so it doesn't change name
This moves most of the version information we need to update into one
place.
Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
Many of our dependencies already made the jump and require a cargo update hack, so make it official
Removed the MSRV from the README since it applies to master branch and people read the readme also for
the released version. There is enough documentation of the MSRV in other locations.
- From C++, always call the Window::show() and hide() function instead
of going through set_visible directly as it doesn't set the size of
the WindowItem
- show() should also call resize on the renderer
- remove the is_visible in the WindowAdapterInternal as it is no longer
needed
For node and cpp, I use relative links to point to the slint language
reference documentation.
For the slint crate documentation I create a link to
https://slint-ui.com/releases/VERSION/... instead: This needs to work from
docs.rs as well as from our own docs area on slint-ui.com! That is
pretty ugly: I can not even define constants for this as the crate docs
need to come before anything else.
These are two different concept, and it is confusing to keep them in the
same enum
We want to support component without any base element, and Void is
already used for global component, so do this refactoring before
* Add `RequestedSize` and `RequestedPosition` enum to enable asking for
logical or physical size/position.
* Rename `Window::size()` to `Window::physical_size()`
* Make `Window::set_size(...)` take an `Into<RequestedSize>`
* Rename `Window::position()` to `Window::physical_position()`
* Make `Window::set_position(...)` take an `Into<RequestedPosition>`
* Change `WindowAdapter` and related classes to be able to handle
requests being made in the either physical or logical units.
Implement this for C++, Rust and node.