Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Jun 23, 2024

This PR makes the various asyncLoad implementations (node, esm, and system) operate more consistently, and updates their tests. In particular, relative file names are resolved using the root directory, while other names are used as is. That allows using package names like mathjax-full, for example (at least in the implementation where that is possible).

In addition, there is a new flag that indicates whether the asyncLoad command is synchronous, use by the font's dynamic file loading command loadDynamicFilesSync() to determine if it can work or not.

There is also a fix to FontData.js that resolves a problem with having removed the .js from file names, which are needed by asyncLoad().

The asyncLoad/node.js implementation is modified to be able to be used by both ESM and CJS modules (by calling on the #source/srouce.js file to obtain the __dirname value used to construct the root).

Finally, all the tests are updated to include tests for non-relative file names, and for the synchronous flag.

@dpvc dpvc requested a review from zorkow June 23, 2024 18:01
@dpvc dpvc added this to the v4.0 milestone Jun 23, 2024
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit e9156ba into develop Jun 27, 2024
@dpvc dpvc deleted the better-asyncLoad branch June 27, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants