jsdelivr / jsdelivr

A free, fast, and reliable Open Source CDN for npm, GitHub, Javascript, and ESM
https://www.jsdelivr.com
MIT License
5.63k stars 2.05k forks source link

Request to increase package size limit for Fontsource #18279

Closed ayuhito closed 3 years ago

ayuhito commented 3 years ago

Link to the npm package or GitHub repository Main repo: https://github.com/fontsource/fontsource

An example offending package: https://github.com/fontsource/fontsource/tree/master/packages/noto-serif-tc https://www.npmjs.com/package/@fontsource/noto-serif-tc https://cdn.jsdelivr.net/npm/@fontsource/noto-serif-jp/metadata.json

Project license MIT

Your relation to the project Maintainer

Short description of the project Fontsource is a monorepo that allows developers to self-host fonts with the ease of NPM packages. This repository automatically keeps itself updated with Google Fonts.

The issue stems from certain fonts that support languages with many many characters, and thus the package sizes can get fairly large. These binary files aren't something I can exactly tone down as we also try mirroring Google Fonts.

I'm currently working on a new search directory that dynamically loads each font for users to 'preview' similar to Google Fonts. Over here, you can see I've tried my options with GitHub API (too many restrictions) and jsdelivr (for the odd few packages that will fail to load) and thus I've had to go with UNPKG. The only reason I want to continue using jsdelivr is that the platform looks more stable and supported in the long term.

Is it possible to whitelist the entire @fontsource NPM package scope in the case Google introduces new fonts into their ecosystem that exceeds the file size? Noto Serif TC is only one of few packages that exceed your package limits and I won't always notice if a new large package is introduced to create issues like this (in which case it would be more convenient to go with UNPKG). Almost all existing packages fall under the limits.

Please confirm the following:

MartinKolarik commented 3 years ago

Hi @DecliningLotus, we removed the limit for @fontsource. It may take up to 12 hours for the change to fully propagate.

ayuhito commented 3 years ago

Awesome. Appreciate the work done to get that working, thank you.