fimo-next 2.8.0-staging.9 → 2.9.0-staging.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/README.md CHANGED
@@ -24,3 +24,10 @@ indicator in hosted Previews while leaving local `next dev` unchanged. Explicit
24
24
  const nextConfig = { devIndicators: { position: 'bottom-left' } };
25
25
  export default withFimo(nextConfig);
26
26
  ```
27
+
28
+ In Fimo previews, `withFimo` also adapts framing headers returned by the
29
+ application's `headers()` function to permit the trusted Studio parent.
30
+ Published builds retain the original policy. Other CSP directives and security
31
+ headers stay unchanged. Headers added by middleware or a custom server are not
32
+ rewritten. Update `fimo` and its companion packages together and rebuild older
33
+ previews to use this behavior.
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { resolveFimoEditingMetadata } from 'fimo/preview';
1
+ import { adaptPreviewFrameHeaderRules, resolveFimoEditingMetadata } from 'fimo/preview';
2
2
  const NEXT_DEVELOPMENT_PHASE = 'phase-development-server';
3
3
  const PREVIEW_ORIGINS_ENV = 'FIMO_PREVIEW_ALLOWED_ORIGINS';
4
4
  function readPreviewOrigins() {
@@ -34,11 +34,18 @@ function withConfigTracing(config) {
34
34
  export function withFimo(applicationConfig) {
35
35
  return async (phase, context) => {
36
36
  const applied = typeof applicationConfig === 'function' ? await applicationConfig(phase, context) : applicationConfig;
37
+ const studioOrigin = process.env.FIMO_PREVIEW_PARENT_ORIGIN;
38
+ const headers = applied.headers;
37
39
  const editing = resolveFimoEditingMetadata(phase === NEXT_DEVELOPMENT_PHASE ? 'development' : 'production', process.env.FIMO_EDITING_METADATA);
38
40
  const compiler = applied.compiler;
39
41
  const removeProperties = compiler?.reactRemoveProperties;
40
42
  const config = withConfigTracing({
41
43
  ...applied,
44
+ ...(studioOrigin && headers
45
+ ? {
46
+ headers: async () => adaptPreviewFrameHeaderRules(await headers.call(applied), studioOrigin),
47
+ }
48
+ : {}),
42
49
  ...(!editing
43
50
  ? {
44
51
  compiler: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo-next",
3
- "version": "2.8.0-staging.9",
3
+ "version": "2.9.0-staging.1",
4
4
  "description": "Fimo runtime for Next.js projects.",
5
5
  "files": [
6
6
  "dist/",
@@ -49,22 +49,22 @@
49
49
  "test:watch": "vitest"
50
50
  },
51
51
  "devDependencies": {
52
- "@fimo/tsconfig": "2.8.0-staging.9",
52
+ "@fimo/tsconfig": "2.9.0-staging.1",
53
53
  "@tanstack/react-query": "^5.80.6",
54
54
  "@types/node": "22.18.6",
55
55
  "@types/react": "19.2.14",
56
56
  "@types/react-dom": "19.2.3",
57
- "fimo": "2.8.0-staging.9",
58
- "fimo-react": "2.8.0-staging.9",
59
- "next": "16.3.8",
57
+ "fimo": "2.9.0-staging.1",
58
+ "fimo-react": "2.9.0-staging.1",
59
+ "next": "16.4.2",
60
60
  "react": "19.2.4",
61
61
  "react-dom": "19.2.4",
62
62
  "typescript": "7.0.2",
63
- "vitest": "5.0.3"
63
+ "vitest": "5.0.4"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@tanstack/react-query": "^5.80.6",
67
- "fimo": "2.8.0-staging.9",
67
+ "fimo": "2.9.0-staging.1",
68
68
  "fimo-react": ">=2.0.1",
69
69
  "next": "^15.0.0 || ^16.0.0",
70
70
  "react": "^18.2.0 || ^19.0.0",