Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(windows): keyboard load blob #12684

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

rc-swag
Copy link
Contributor

@rc-swag rc-swag commented Nov 22, 2024

Fixes: #12500

ermshiperete and others added 30 commits August 20, 2024 22:45
`emcc.py` is not marked as executable in emcripten's git repo so the
build failed when trying to locate emscripten. However, it turns out
that `emcc` is marked as executable, so we use that instead.

On Windows however, we still need to use `emcc.py` because otherwise
Meson won't detect it as valid compiler.
- add temporary function to Core for this POC
- add new CoreProcessor to access Keyman Core WASM
- add unit tests for new core processor
- add code to KeymanEngine and InputProcessor to load the new CoreProcessor
- add web server to manual tests and new action `start` to build script

This change requires the manual tests to be loaded from a web server
instead of loaded as file, because otherwise the wasm code won't be
loaded.

Currently we always load CoreProcessor. This should be improved in a future
change to only load when it is actually needed.

Part-of: #11293
feat(web): POC of Core WASM integration into Keyman Web
- loading a keyboard from a BLOB
- getting the on-screen keyboard layout from Core. This is an internal-
  only API because of it's use of C++.

Part-of: #11293
Part-of: #8093
…core

chore: merge master into web-core 🎼
- split keyboard loading into loading into blob and then loading the script
- look at first four bytes to see if it's a .js or a .kmx keyboard
- for domKeyboardLoader, use fetch to get the blob, then use indirect
  eval to load the script, instead of injecting a script element.

This does not yet implement the loading of .kmx keyboards.
Addresses code review comments.
feat(core): spec out Core API extensions 🎼
#11746 removed the `ts-node` dependency. Unfortunately that broke running
TypeScript test files with Mocha in VSCode Test Explorer because it no
longer knows what to do with .ts files. This change adds the more modern
`tsx` package as developer dependency, which allows to use Test Explorer
again.

See https://stackoverflow.com/a/77609121.
Addresses code review comments.
…core

chore: merge master into web-core 🎼
Addresses code review comments.
refactor(web): move kbdInterface tests to typescript 🎼
- split keyboard loading into loading KMX file into blob and then
  loading the keyboard processor from the blob.
- deprecate `km_core_keyboard_load`
- move file access next to deprecated method. This is now the only place
  that loads a file in Core; unit tests have some more places that
  load files.
- introduce GTest and add unit tests for loading from blob

Part-of: #11293
ermshiperete and others added 19 commits October 9, 2024 09:01
…core

chore(web): merge `master` into `epic/web-core` 🎼
feat(web): refactor loading of .js keyboards  🎼
feat(core): implement loading KMX from blob 🎼
…core

chore: merge master into web-core 🎼
This fixes a meson warning that `common/include` was specified
multiple times (in `core/include/meson.build` and
`core/tests/meson.build`).
Due to emscripten bug emscripten-core/emscripten#22754 specifying only
`webview` as environment resulted in a broken `core.js` file when doing
a debug build. In release builds things worked because of the
`-Wl,-O1 -O2` that meson added for the release build. This change works
around that bug by adding `web` as additional environment.
fix(core): cleanup include directories 🎼
fix(core): fix generated `core.js` file for debug builds 🎼
This gives us access to the keyboards needed for the core-processor tests.
…core

chore: merge master into web-core 🎼
feat(core): rename `core.js` to `km-core.js` 🎼
feat(core): run tests from `KEYMAN_ROOT` instead of `web` 🎼
…core

chore: merge master into web-core 🎼
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common/resources/ Build infrastructure common/ core/ Keyman Core docs feat linux/ user-test-missing User tests have not yet been defined for the PR web/ windows/
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

refactor(windows): implement loading of keyboard blob in Keyman for Windows
3 participants