@netlify/plugin-nextjs 4.29.2-alpha-isr-404.0 → 4.29.2

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.
@@ -303,7 +303,7 @@ const baseServerReplacements = [
303
303
  `checkIsManualRevalidate(process.env._REVALIDATE_SSG ? { headers: { 'x-prerender-revalidate': this.renderOpts.previewProps.previewModeId } } : req, this.renderOpts.previewProps)`,
304
304
  ],
305
305
  // ensure ISR 404 pages send the correct SWR cache headers
306
- [`private: isPreviewMode || is404Page`, `private: isPreviewMode || false`],
306
+ [`private: isPreviewMode || is404Page && cachedData`, `private: isPreviewMode && cachedData`],
307
307
  ];
308
308
  const nextServerReplacements = [
309
309
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "4.29.2-alpha-isr-404.0",
3
+ "version": "4.29.2",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@delucis/if-env": "^1.1.2",
39
- "@netlify/build": "^28.1.15",
39
+ "@netlify/build": "^28.2.2",
40
40
  "@types/fs-extra": "^9.0.13",
41
41
  "@types/jest": "^27.4.1",
42
42
  "@types/merge-stream": "^1.1.2",
@@ -43,11 +43,14 @@ const handler = async (req, context) => {
43
43
  return
44
44
  }
45
45
 
46
- // This is the format expected by Next.js
46
+ // This is the format expected by Next.js along with the timezone which we support.
47
47
  const geo = {
48
48
  country: context.geo.country?.code,
49
49
  region: context.geo.subdivision?.code,
50
50
  city: context.geo.city,
51
+ latitude: context.geo.latitude?.toString(),
52
+ longitude: context.geo.longitude?.toString(),
53
+ timezone: context.geo.timezone,
51
54
  }
52
55
 
53
56
  // A default request id is fine locally
@@ -20,6 +20,7 @@ export interface RequestData {
20
20
  region?: string
21
21
  latitude?: string
22
22
  longitude?: string
23
+ timezone?: string
23
24
  }
24
25
  headers: Record<string, string>
25
26
  ip?: string
@@ -63,10 +64,13 @@ const handler = async (req: Request, context: Context) => {
63
64
  return
64
65
  }
65
66
 
66
- const geo = {
67
+ const geo: RequestData['geo'] = {
67
68
  country: context.geo.country?.code,
68
69
  region: context.geo.subdivision?.code,
69
70
  city: context.geo.city,
71
+ latitude: context.geo.latitude?.toString(),
72
+ longitude: context.geo.longitude?.toString(),
73
+ timezone: context.geo.timezone,
70
74
  }
71
75
 
72
76
  const requestId = req.headers.get('x-nf-request-id')