Commit graph

9 commits

Author SHA1 Message Date
Florian Blasius
bf77b064ab
Replace neon node port (#3744)
* Update api/node/README.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-24 15:07:59 +02:00
Florian Blasius
2324b35d12
napi test driver setup (#3635)
* 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>
2023-10-11 12:48:27 +02:00
Florian Blasius
e34cd741a8
Create components from a slint file for napi (#3566)
* Get todo example running with napi.

* Code review fixes.

* Code review feedback.

* Code review fixes.

* docs fix

* Update api/napi/__test__/resources/error.slint

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update api/napi/__test__/resources/test.slint

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix test

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-06 12:39:17 +02:00
Florian Blasius
d43f5fe99a
Added window js wrapper for napi (#3544)
* Added window js wrapper for napi

* Remove position tests.

* Update api/napi/src/types/size.rs

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review fixes

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-09-29 08:29:36 +02:00
Simon Hausmann
bbc192b141 napi: Improve error message when setting non-existent properties and callbacks 2023-08-08 13:52:59 +02:00
Simon Hausmann
9df29b1a35 Add test coverage for setting non-existent properties and callbacks 2023-08-08 13:52:59 +02:00
Simon Hausmann
5d102bc838 napi: Fix access to diagnostics
Invoking the diagnostics getter would throw an exception because the JsDiagnostic type has no constructor.

There's however no constructor that would allow for the previous
laziness, so instead this PR bites the bullet:

- When diagnostics are requested, we convert them all in one go into proper JavaScript objects.
- The vector returned by line_column is replaced with more idiomatic column and lineNumber properties
2023-08-08 13:46:53 +02:00
Simon Hausmann
63df4b78c3 napi: Add tests that verify that lookup of non-existent global callbacks and properties fails 2023-08-08 13:44:12 +02:00
Simon Hausmann
56feda7ad9 napi: Fix typo in file name 2023-08-07 13:30:06 +02:00
Renamed from api/napi/__test__/copiler.spec.ts (Browse further)