fontdue-js 3.0.0 → 3.0.1

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.0.1
2
+
3
+ - Fixed analytics tracking and consent events posting to the wrong address in non-Next.js frameworks. In Vite-based setups (Astro, React Router 7, TanStack Start) that configure the Fontdue URL through `PUBLIC_FONTDUE_URL` / `VITE_FONTDUE_URL` and pass a `preloadedQuery` to `<FontdueProvider>` (rather than an explicit `url` prop), the page-view and consent requests went to a relative `/api/track/page` on the site’s own origin instead of the configured Fontdue server. They now resolve the Fontdue URL the same way GraphQL requests do. Next.js sites were unaffected.
4
+
1
5
  ## 3.0.0
2
6
 
3
7
  - **Framework-agnostic.** fontdue-js now works in any React SSR or client-only environment — Astro, React Router 7, TanStack Start, Vike, Remix, and the existing Next.js App Router — not just Next.js. Each supported framework has a worked example repo (see the README "Examples"). The package is now ESM-only and ships an `exports` map, so TypeScript consumers need `moduleResolution` set to `bundler`, `node16`, or `nodenext`.
@@ -3,7 +3,7 @@
3
3
  import React, { Suspense, createContext, useContext, useRef } from 'react';
4
4
  import { Provider } from 'react-redux';
5
5
  import { RelayEnvironmentProvider } from 'react-relay';
6
- import { useCurrentEnvironment } from '../../relay/environment.js';
6
+ import { useCurrentEnvironment, fontdueBaseUrl } from '../../relay/environment.js';
7
7
  import ConfigContext, { makeConfig, mergeConfig } from '../ConfigContext.js';
8
8
  import { createDefaultStore } from '../../reducer.js';
9
9
  import ComponentsContext from '../ComponentsContext.js';
@@ -143,7 +143,7 @@ export default function FontdueContextProvider(_ref3) {
143
143
  }, /*#__PURE__*/React.createElement(ConfigContext.Provider, {
144
144
  value: configValue
145
145
  }, /*#__PURE__*/React.createElement(UrlContext.Provider, {
146
- value: url ?? (typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_FONTDUE_URL : undefined) ?? ''
146
+ value: url ?? fontdueBaseUrl() ?? ''
147
147
  }, /*#__PURE__*/React.createElement(ComponentsContext.Provider, {
148
148
  value: components ?? {}
149
149
  }, /*#__PURE__*/React.createElement(TypeTesterFamiliesProvider, null, children)))))))));
@@ -7,7 +7,7 @@ import { PREVIEW_HEADER, hasPreviewMarkerCookie } from '../preview/constants.js'
7
7
  // (defineVersionPlugin in .babelrc.cjs) with the literal package.json#version.
8
8
  // Exported so UI (the admin toolbar) can surface it without re-reading the
9
9
  // build-time global in a 'use client' module.
10
- export const version = "3.0.0";
10
+ export const version = "3.0.1";
11
11
  const IS_SERVER = typeof window === typeof undefined;
12
12
 
13
13
  // Opt server fetches into Next's data cache only in production; dev stays
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "npm run relay && run-p build-js build-css build-ts",