Skip to content

Commit 40d0385

Browse files
authored
Don’t automatically inject @astrojs/react integration (#53)
1 parent 49ba8bc commit 40d0385

File tree

4 files changed

+23
-52
lines changed

4 files changed

+23
-52
lines changed

.changeset/two-lobsters-sit.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'astro-netlify-cms': minor
3+
---
4+
5+
Don’t automatically inject `@astrojs/react` integration
6+
7+
⚠️ BREAKING CHANGE ⚠️
8+
9+
Previously, this integration included [`@astrojs/react`](https://docs.astro.build/en/guides/integrations-guide/react/) and injected it to Astro’s integrations config for you. This is no longer the case.
10+
11+
If you are using React components and were relying on this, make sure to add the integration when upgrading. The simplest way to do this is to run:
12+
13+
```bash
14+
npx astro add react
15+
```

integration/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import type { AstroIntegration, AstroUserConfig } from 'astro';
22
import type { CmsConfig } from 'netlify-cms-core';
33
import { spawn } from 'node:child_process';
4-
import react from '@astrojs/react';
5-
import AdminDashboard from './vite-plugin-admin-dashboard.js';
64
import type { PreviewStyle } from './types.js';
5+
import AdminDashboard from './vite-plugin-admin-dashboard.js';
76

87
const widgetPath = 'astro-netlify-cms/identity-widget';
98

@@ -90,5 +89,5 @@ export default function NetlifyCMS({
9089
},
9190
},
9291
};
93-
return [react(), NetlifyCMSIntegration];
92+
return NetlifyCMSIntegration;
9493
}

package-lock.json

Lines changed: 6 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"netlify-cms"
2828
],
2929
"dependencies": {
30-
"@astrojs/react": "^1.2.1",
3130
"@types/react": "^17.0.50",
3231
"netlify-cms-app": "^2.15.66",
3332
"netlify-cms-proxy-server": "^1.3.23",

0 commit comments

Comments
 (0)