Uh oh!
There was an error while loading. Please reload this page.
Browser build - #137
Conversation
indolering
commented
Sep 21, 2017
Fixes #137. |
| } | ||
| export default AbstractFontKit; |
There was a problem hiding this comment.
I didn't want Browserify to polyfill the fs module so I created this parent class. If this looks good I can refactor index and base to use it.
| return promise; | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Returning a promise should be backwards compatible with the existing API....
devongovett
commented
Sep 22, 2017
Why does the browserify build need to be in fontkit itself? Wouldn't you just browserify your entire project instead? For an example of using fontkit in the browser, check out fontkit-demo. |
talltyler
commented
Sep 26, 2017
Projects that use fontkit don't always use browserify to build. The logic is every module should include the dependencies that it needs to run. Forcing every project that uses your code to also use your build system limits the number of people able to run your code. |
indolering
commented
Sep 28, 2017
The build is designed to accommodate freestanding installs, so you can pull in fontkit via something like cdnjs or jsDelivr.
Not if you aren't using Browserify to begin with. But this PR also makes it easier to do that via AbstractFontKit and the browser-specific FontKit classes.
Right, I'm trying to save people the hassle of reverse engineering your non-standard build system and writing their own loading function 😄 . |
jakubzitny
commented
Aug 24, 2018
This should definitely be merged. Or propose a solution that you'll be willing to merge @devongovett, please. |
Munter
commented
Sep 14, 2018
I'm very interested in this PR. I wouldn't even use the |
scottrippey
commented
Nov 30, 2018
I've attempted to resurrect this PR, so I created #183 . |
devongovett
commented
May 20, 2022
Handled in #276 |
Initial attempt at adding support for a browser build.