keymanapp / keymanweb.com

https://keymanweb.com/ source
2 stars 2 forks source link

feat: simplify KMW init by requiring 13.0+, use of Promises #29

Closed jahorton closed 2 years ago

jahorton commented 3 years ago

Happy for this site to support 13.0+ at this point if that makes things more elegant? _Originally posted by @mcdurdin in https://github.com/keymanapp/keymanweb.com/pull/28#discussion_r592868109_

If KMW's script is the last thing to load on the page, keyman.init may not have been called, meaning the touch-aliases won't have been built yet. If we could wait on init's Promise, we could eliminate this timeout in favor of that.

Assuming that making an init call here is safe, granted: this function doesn't know whatever options the site may be setting elsewhere for its init. _Originally posted by @jahorton in https://github.com/keymanapp/keymanweb.com/pull/28#discussion_r592868109_

So, a bit of investigation may be necessary (b/c 2x init calls) to make sure everything would work safely, but I believe this should be possible to implement.