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: conversion of Keyman Engine for Web to ES modules 🧩 #8560

Merged
merged 510 commits into from
Jun 26, 2023

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Apr 1, 2023

This is the base branch for an ongoing conversion of Keyman Engine for Web code; when complete, it will be based upon use of ES modules rather than the old "namespace"-style structure it was previously using.

Other goals include complete modularization of Keyman Engine for Web's on-screen keyboard component. While still included in KMW, it will also be able to function independently and be compilable as a standalone project. As we are considering reuse of Web's OSK within the desktop-platform Keyman apps, this will be a very notable step toward accomplishing such a goal.

At this time, this branch also includes an update for Web's README.md corresponding to the changeset from the 📜 set of Web code reorganization PRs ending with #7831. (It should be re-updated again near completion.)


Approximate state of modularization so far (so GitHub won't hide the comment on us):

graph TD;
    OSK[web/src/engine/osk];
    KP["common/web/keyboard-processor"];
    IP["common/web/input-processor"];
    OSK-->KP;
    IP-->KP;
    Utils["common/web/utils"];
    KP---->Utils;
    Wordbreakers["common/models/wordbreakers"];
    Models["common/models/templates"];
    Models-->Utils;
    LMWorker["common/web/lm-worker"];
    LMWorker-->Models;
    LMWorker-->Wordbreakers;
    LMLayer["common/predictive-text"];
    LMLayer-->LMWorker;
    IP-->LMLayer;

    subgraph PredText["WebWorker + its interface"]
        LMLayer;
        LMWorker;
        Models;
        Wordbreakers;
    end

    subgraph Headless["Fully headless components"]
        direction LR
        KP;
        IP;
        Utils;
        PredText;
    end

    subgraph ClassicWeb["Previously unmodularized components"]
        Device[web/src/engine/device-detect];
        Device----->Utils;
        Elements[web/src/engine/element-wrappers];
        Elements-->KP;
        KeyboardCache[web/src/engine/package-cache];
        KeyboardCache-->IP;
        DomUtils[web/src/engine/dom-utils];
        DomUtils-->Utils;
        OSK-->DomUtils;
        OSK---->IP;
        Configuration[web/src/engine/paths];
        Configuration-->OSK;
        CommonEngine[web/src/engine/main];
        CommonEngine-->Configuration;
        CommonEngine-->Device;
        CommonEngine-->KeyboardCache;
        CommonEngine-->OSK;
        Attachment[web/src/engine/attachment];
        Attachment-->DomUtils;
        Attachment-->Elements;
    end

    subgraph WebEngine["Keyman Engine for Web (top-level libraries)"]
        Browser[web/src/app/browser];
        WebView[web/src/app/webview];

        WebView--->CommonEngine;

        Browser--->CommonEngine;
        Browser-->Attachment;
    end
Loading

(This technically includes changes from not-yet-published commits, but it's pretty accurate to where things are headed.)

Note that the element-wrappers child package will be referenced by the app/browser target, which is not included in the graph above. (It'd rest higher up.)


Pending tasks of note:

Note: Refer also to #8047, the original version of this PR before a git merge disaster happened on what was intended as a child PR.

User Testing

Due to the scale of user testing involved, the actual user tests will be posted under separate issues:

TEST_MAIN_WEB: See #9037 / #9037 (comment).

TEST_OTHERS: See #9039 / #9039 (comment)

TBD(?): do the mobile apps need their own full regression tests again?

@jahorton jahorton added this to the A17S9 milestone Apr 1, 2023
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Apr 1, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Apr 1, 2023

@jahorton
Copy link
Contributor Author

jahorton commented Apr 1, 2023

For any changes before this point, refer to #8047 and its descendant PRs, which were all merged properly after reviews - that is, before the accidental merge disaster triggered by merging #8549, which had its base branch improperly set.

Anything after this point is from work after the necessary git-reversion shenanigans that were needed to patch up the state of the repo.

@mcdurdin mcdurdin modified the milestones: A17S9, A17S10 Apr 4, 2023
@mcdurdin mcdurdin marked this pull request as draft April 4, 2023 21:43
@mcdurdin mcdurdin removed this from the A17S10 milestone Apr 15, 2023
jahorton and others added 6 commits June 20, 2023 13:15
Co-authored-by: Marc Durdin <marc@durdin.net>
Co-authored-by: Marc Durdin <marc@durdin.net>
…st-script-loading

change(web): web integration test-script loading 🧩
docs(web): demarcation of methods supporting Web's public API 🧩
@jahorton
Copy link
Contributor Author

jahorton commented Jun 23, 2023

TEST_OTHERS: PASSED

TEST_MAIN_WEB: PASSED - Though an issue did arise for one of the tests due to differences between a test keyboard's phone and tablet layouts. I've made tweaks accordingly.

The quick version there: khmer_angkor's tablet layout doesn't do subconsonant subkeys like its phone layout. The original version of one test's spec didn't account for that.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Jun 23, 2023
@mcdurdin mcdurdin modified the milestones: A17S15, A17S16 Jun 26, 2023
@jahorton jahorton marked this pull request as ready for review June 26, 2023 02:08
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

LGTM

@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.130-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants