@oxyhq/bloom 0.71.0 → 0.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/commonjs/fonts/apply-font-faces.js +5 -4
  2. package/lib/commonjs/fonts/apply-font-faces.js.map +1 -1
  3. package/lib/commonjs/fonts/apply-font-faces.web.js +14 -16
  4. package/lib/commonjs/fonts/apply-font-faces.web.js.map +1 -1
  5. package/lib/commonjs/fonts/assets/BlomusModernus-Bold.woff2 +0 -0
  6. package/lib/commonjs/fonts/assets/BlomusModernus-Regular.woff2 +0 -0
  7. package/lib/commonjs/fonts/assets/GeistMono-Variable.woff2 +0 -0
  8. package/lib/commonjs/fonts/assets/InterVariable.woff2 +0 -0
  9. package/lib/commonjs/fonts/font-assets.web.js +3 -2
  10. package/lib/commonjs/fonts/font-assets.web.js.map +1 -1
  11. package/lib/commonjs/fonts/font-urls.web.js +35 -0
  12. package/lib/commonjs/fonts/font-urls.web.js.map +1 -0
  13. package/lib/module/fonts/apply-font-faces.js +5 -4
  14. package/lib/module/fonts/apply-font-faces.js.map +1 -1
  15. package/lib/module/fonts/apply-font-faces.web.js +14 -16
  16. package/lib/module/fonts/apply-font-faces.web.js.map +1 -1
  17. package/lib/module/fonts/assets/BlomusModernus-Bold.woff2 +0 -0
  18. package/lib/module/fonts/assets/BlomusModernus-Regular.woff2 +0 -0
  19. package/lib/module/fonts/assets/GeistMono-Variable.woff2 +0 -0
  20. package/lib/module/fonts/assets/InterVariable.woff2 +0 -0
  21. package/lib/module/fonts/font-assets.web.js +3 -2
  22. package/lib/module/fonts/font-assets.web.js.map +1 -1
  23. package/lib/module/fonts/font-urls.web.js +32 -0
  24. package/lib/module/fonts/font-urls.web.js.map +1 -0
  25. package/lib/module/fonts/index.web.js +3 -3
  26. package/lib/typescript/commonjs/fonts/apply-font-faces.d.ts.map +1 -1
  27. package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts +9 -11
  28. package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts.map +1 -1
  29. package/lib/typescript/commonjs/fonts/font-assets.web.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/fonts/font-urls.web.d.ts +6 -0
  31. package/lib/typescript/commonjs/fonts/font-urls.web.d.ts.map +1 -0
  32. package/lib/typescript/module/fonts/apply-font-faces.d.ts.map +1 -1
  33. package/lib/typescript/module/fonts/apply-font-faces.web.d.ts +9 -11
  34. package/lib/typescript/module/fonts/apply-font-faces.web.d.ts.map +1 -1
  35. package/lib/typescript/module/fonts/font-assets.web.d.ts.map +1 -1
  36. package/lib/typescript/module/fonts/font-urls.web.d.ts +6 -0
  37. package/lib/typescript/module/fonts/font-urls.web.d.ts.map +1 -0
  38. package/package.json +4 -7
  39. package/src/__tests__/apply-font-faces.test.ts +32 -0
  40. package/src/fonts/apply-font-faces.ts +5 -4
  41. package/src/fonts/apply-font-faces.web.ts +14 -16
  42. package/src/fonts/font-assets.web.ts +3 -2
  43. package/src/fonts/font-urls.web.ts +30 -0
  44. package/src/fonts/index.web.ts +3 -3
  45. package/lib/commonjs/fonts/font-data.web.js +0 -22
  46. package/lib/commonjs/fonts/font-data.web.js.map +0 -1
  47. package/lib/module/fonts/font-data.web.js +0 -18
  48. package/lib/module/fonts/font-data.web.js.map +0 -1
  49. package/lib/typescript/commonjs/fonts/font-data.web.d.ts +0 -5
  50. package/lib/typescript/commonjs/fonts/font-data.web.d.ts.map +0 -1
  51. package/lib/typescript/module/fonts/font-data.web.d.ts +0 -5
  52. package/lib/typescript/module/fonts/font-data.web.d.ts.map +0 -1
  53. package/src/fonts/font-data.web.ts +0 -15
@@ -0,0 +1,30 @@
1
+ // Web font URLs, resolved by whatever bundler is building the consuming app.
2
+ //
3
+ // WEB-ONLY. Each import below hands the `.woff2` to the app's asset pipeline,
4
+ // which emits it as a standalone file and gives us back its URL:
5
+ //
6
+ // - Metro (Expo web) rewrites the import to the exported asset path — its
7
+ // asset transformer emits a bare string module whenever the platform is
8
+ // `web`, so the imported value is the URL itself, not an asset id.
9
+ // - Vite, Rollup and webpack 5 resolve it through their own asset handling
10
+ // and return a content-hashed URL.
11
+ //
12
+ // Either way the browser fetches the four families alongside the JS and caches
13
+ // them under their own URLs, instead of re-parsing ~310 KB of base64 out of the
14
+ // entry bundle on every cold load. No consumer ever writes an asset filename
15
+ // down, so a font swap here cannot leave a downstream app pointing at a file
16
+ // that no longer exists.
17
+ //
18
+ // Metro does not carry `woff2` in its default `assetExts`, so a consumer
19
+ // bundling for web with Metro has to register it; `@oxyhq/app-preset`'s Metro
20
+ // base already does that for every Oxy app.
21
+ //
22
+ // Native never reaches this module. The default `apply-font-faces.ts` is a
23
+ // no-op stub and `FontLoader.native.tsx` loads the `.ttf` variants through
24
+ // `useFonts` instead, so no web font bytes enter a native bundle.
25
+ import blomusModernusBold from './assets/BlomusModernus-Bold.woff2';
26
+ import blomusModernusRegular from './assets/BlomusModernus-Regular.woff2';
27
+ import geistMonoVariable from './assets/GeistMono-Variable.woff2';
28
+ import interVariable from './assets/InterVariable.woff2';
29
+
30
+ export { blomusModernusRegular, blomusModernusBold, interVariable, geistMonoVariable };
@@ -6,9 +6,9 @@
6
6
  // of the box), so an extensionless specifier here would quietly fall through
7
7
  // to the default file.
8
8
  //
9
- // - `./apply-font-faces.web` performs the real `@font-face` injection using
10
- // inlined base64 data URLs (see `font-data.web.ts`); the default
11
- // `./apply-font-faces` is a no-op stub for native.
9
+ // - `./apply-font-faces.web` performs the real `@font-face` injection against
10
+ // the `.woff2` URLs the consuming bundler emits (see `font-urls.web.ts`);
11
+ // the default `./apply-font-faces` is a no-op stub for native.
12
12
  // - `./font-assets.web` is an empty map. The native map is built from Metro
13
13
  // asset `require()` calls, and importing it from an ES module throws
14
14
  // `ReferenceError: require is not defined` during module evaluation — which