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

epic: web-core 🎼 #12291

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

epic: web-core 🎼 #12291

wants to merge 84 commits into from

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Aug 27, 2024

ermshiperete and others added 11 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
@mcdurdin mcdurdin added this to the A18S9 milestone Aug 27, 2024
@mcdurdin mcdurdin added web/ core/ Keyman Core epic A long lived branch, home for a new feature, usually will have child PRs based on it labels Aug 27, 2024
@mcdurdin mcdurdin changed the title epic: web-core epic: web-core 🎼 Aug 27, 2024
ermshiperete and others added 2 commits August 30, 2024 14:44
- 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
@srl295 srl295 self-requested a review August 30, 2024 17:28
@darcywong00 darcywong00 modified the milestones: A18S9, A18S10 Aug 31, 2024
…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.
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

Addresses code review comments.
ermshiperete and others added 6 commits December 9, 2024 16:06
Without this change building unit tests fail with an error that
`--shared-memory` is disallowed.
This change renames the type library from `km-core=-interface.d.ts`
to `keymancore.d.ts` to match the name of the target (`keymancore`)
to make it more obvious where this comes from and where/how it gets
build.
feat(core): expose `km_core_keyboard_load_from_blob` to WASM 🎼
The data we read from the KMX file is not in places 32-bit aligned, e.g.
`dpGroupArray` will often start at a 16-bit boundary. Emscripten doesn't
like this and will abort the program if `SAFE_HEAP=1` is defined.

This change works around the problem by calling `CopyKeyboard` and thus
expanding the structure.

See #12844.
@darcywong00 darcywong00 modified the milestones: A18S17, A18S18 Dec 21, 2024
@darcywong00 darcywong00 modified the milestones: A18S18, A18S19 Jan 6, 2025
ermshiperete and others added 2 commits January 6, 2025 14:29
This change adds a new flag `KMX_REQUIRES_REALIGNMENT` instead of the
previous `KMX_64BIT` for the cases where we have to re-align the KMX data
at pointer boundaries. Renamed because Emscripten also needs the
re-alignment even though it's 32-bit.

Addresses code review comments.
fix(core): work around alignment problem when using Emscripten 🎼
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 developer/ide/ developer/ docs epic A long lived branch, home for a new feature, usually will have child PRs based on it epic-web-core linux/engine/ linux/ web/
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants