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

Serialize trie as JSON so it can be required in the browser #2

Closed
wants to merge 1 commit into from

Conversation

dvdsgl
Copy link

@dvdsgl dvdsgl commented Oct 25, 2017

This allows unicode-properties to work in the browser, dropping the dependency on node's fs module.

Fixes #1

This allows unicode-properties to work in the browser, dropping the dependency on node's fs module.

Fixes foliojs#1
@Hopding
Copy link

Hopding commented Jan 15, 2018

I ran into this issue as well. I worked around it by running the node_modules/unicode-properties/index.js file through browserify brfs (https://github.com/browserify/brfs). This inlined the content in data.trie within the index.js file.

This is probably a cleaner solution, though. @devongovett Really hope a fix for this gets put through!

@diegomura
Copy link
Contributor

diegomura commented May 16, 2018

Hi @devongovett . Any update about this?

I would love to see this merged so we can eventually stop depending on browserify shims to run the fontkit ecosystem clientside.

This change mades the trie data a bit heavier (33kb vs. 12kb), but eventually that difference goes away when including the shims on builds, at least for those (as myself) who are running it in the browser.

Thanks in advance!

@devongovett
Copy link
Member

Done in v1.2.0.

spicybackend added a commit to spicybackend/fontkit that referenced this pull request Nov 12, 2024
This version of the unicode-properties package includes a fix that allows it to be used in the browser.
foliojs/unicode-properties#2

It follows that packages that consume this one, such as libraries for building PDFs, will also be able to run anywhere.
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.

unicode-properties does not work in the browser
4 participants