Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions playground/react-emotion/__tests__/react.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ test('should update', async () => {
})

test.runIf(isServe)('should hmr', async () => {
editFile('App.jsx', (code) =>
editFile('src/App.tsx', (code) =>
code.replace('Vite + React + @emotion/react', 'Updated'),
)
await expect.poll(() => page.textContent('h1')).toMatch('Hello Updated')

editFile('Counter.jsx', (code) =>
editFile('src/Counter.tsx', (code) =>
code.replace('color: #646cff;', 'color: #d26ac2;'),
)

Expand All @@ -43,7 +43,7 @@ test('should update button style', async () => {
expect(await getButtonBorderStyle()).toMatch('2px solid rgb(0, 0, 0)')

if (isServe) {
editFile('Counter.jsx', (code) =>
editFile('src/Counter.tsx', (code) =>
code.replace('border: 2px solid #000', 'border: 4px solid red'),
)

Expand Down
10 changes: 1 addition & 9 deletions playground/react-emotion/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
<div id="app"></div>
<script type="module">
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'

ReactDOM.createRoot(document.getElementById('app')).render(
React.createElement(App),
)
</script>
<script type="module" src="./src/main.tsx"></script>
2 changes: 2 additions & 0 deletions playground/react-emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"devDependencies": {
"@babel/plugin-proposal-pipeline-operator": "^7.27.1",
"@emotion/babel-plugin": "^11.13.5",
"@types/react": "^19.1.10",
"@types/react-dom": "^19.1.7",
"@vitejs/plugin-react": "workspace:*"
},
"babel": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useState } from 'react'
import _Switch from 'react-switch'
import { Counter, StyledCode } from './Counter'
const Switch = _Switch.default || _Switch
import { Counter, StyledCode } from './Counter.tsx'

const Switch = (_Switch as any).default || _Switch

function FragmentTest() {
const [checked, setChecked] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function Counter() {
<button
css={css`
border: 2px solid #000;
background: orange;
`}
onClick={() => setCount((count) => count + 1)}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import App from './App.tsx'

ReactDOM.createRoot(document.getElementById('app')!).render(<App />)
4 changes: 3 additions & 1 deletion playground/react-emotion/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default defineConfig({
server: { port: 8904 /* Should be unique */ },
plugins: [
react({
jsxImportSource: '@emotion/react',
babel: {
plugins: ['@emotion/babel-plugin'],
},
Expand All @@ -16,4 +15,7 @@ export default defineConfig({
// to make tests faster
minify: false,
},
optimizeDeps: {
include: ['@emotion/styled/base'],
},
})
10 changes: 0 additions & 10 deletions playground/tsconfig/__tests__/tsconfig.spec.ts

This file was deleted.

2 changes: 0 additions & 2 deletions playground/tsconfig/index.html

This file was deleted.

21 changes: 0 additions & 21 deletions playground/tsconfig/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions playground/tsconfig/src/App.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions playground/tsconfig/vite.config.ts

This file was deleted.

8 changes: 7 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading