Skip to content

Commit

Permalink
breaking: no index html (#289)
Browse files Browse the repository at this point in the history
* wip: 01 counter without ssr

* wip: prd 01 counter without ssr

* a fix

* wip: dev 01 counter with ssr

* remove unused

* hack only in DEV

* wip: prd 01 counter with ssr

* remove unused config

* example 02

* example 03

* example 04

* example 05

* example 06

* wip: example 07

* fix embedding prefetch code

* example 08

* example 09

* example 10

* example 11 and fix hmr

* example 12 and fix hmr

* update website

* update fixtures

* update CHANGELOG

* website: a hack for layout assets

* fix tests

* increase timeout for CI

* remove unnecessary init

* use expect.poll instead

* a hack to supress a warning

* trial: specify optimizeDeps

* fix format

* trial force reloading

* Revert "trial force reloading"

This reverts commit de92f69.

* add vite config for 11_form
  • Loading branch information
dai-shi committed Dec 19, 2023
1 parent 0996c30 commit 7c0a6ef
Show file tree
Hide file tree
Showing 66 changed files with 392 additions and 902 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
### Added
- breaking: no index html #289

## [0.18.1] - 2023-12-15
### Changed
Expand Down
8 changes: 4 additions & 4 deletions e2e/examples-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ for (const cwd of examples) {

test('check title', async ({ page }) => {
await page.goto(`http://localhost:${port}/`);
const title = await page.title();
expect(title).toBe('Waku example');
// title maybe doesn't ready yet
await page.waitForLoadState('load');
await expect.poll(() => page.title()).toBe('Waku example');
});
});
}
Expand Down Expand Up @@ -173,8 +174,7 @@ for (const cwd of examples) {
await page.goto(`http://localhost:${port}/`);
// title maybe doesn't ready yet
await page.waitForLoadState('load');
const title = await page.title();
expect(title).toBe('Waku example');
await expect.poll(() => page.title()).toBe('Waku example');
});
});
}
Expand Down
37 changes: 0 additions & 37 deletions e2e/fixtures/rsc-basic/index.html

This file was deleted.

1 change: 1 addition & 0 deletions e2e/fixtures/rsc-basic/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ServerBox } from './Box.js';
const App = ({ name }: { name: string }) => {
return (
<ServerBox>
<title>Waku example</title>
<p data-testid="app-name">{name}</p>
<ClientCounter />
<ServerPing />
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/rsc-basic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ const rootElement = (
</StrictMode>
);

createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
37 changes: 0 additions & 37 deletions e2e/fixtures/rsc-router/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/fixtures/rsc-router/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const rootElement = (
</StrictMode>
);

createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
1 change: 1 addition & 0 deletions e2e/fixtures/rsc-router/src/routes/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Pending = ({ isPending }: { isPending: boolean }) => (

const HomeLayout = ({ children }: { children: ReactNode }) => (
<div>
<title>Waku example</title>
<ul>
<li>
<Link
Expand Down
37 changes: 0 additions & 37 deletions e2e/fixtures/ssr-basic/index.html

This file was deleted.

1 change: 1 addition & 0 deletions e2e/fixtures/ssr-basic/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Counter } from './Counter.js';
const App = ({ name }: { name: string }) => {
return (
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
<title>Waku example</title>
<h1 data-testid="app-name">{name}</h1>
<Counter />
</div>
Expand Down
4 changes: 2 additions & 2 deletions e2e/fixtures/ssr-basic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const rootElement = (
);

if ((globalThis as any).__WAKU_SSR_ENABLED__) {
hydrateRoot(document.getElementById('root')!, rootElement);
hydrateRoot(document.body, rootElement);
} else {
createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
}
37 changes: 0 additions & 37 deletions examples/01_counter/index.html

This file was deleted.

1 change: 1 addition & 0 deletions examples/01_counter/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Counter } from './Counter.js';
const App = ({ name }: { name: string }) => {
return (
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
<title>Waku example</title>
<h1>Hello {name}!!</h1>
<h3>This is a server component.</h3>
<Counter />
Expand Down
4 changes: 2 additions & 2 deletions examples/01_counter/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const rootElement = (
);

if ((globalThis as any).__WAKU_SSR_ENABLED__) {
hydrateRoot(document.getElementById('root')!, rootElement);
hydrateRoot(document.body, rootElement);
} else {
createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
}
37 changes: 0 additions & 37 deletions examples/02_async/index.html

This file was deleted.

1 change: 1 addition & 0 deletions examples/02_async/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Counter } from './Counter.js';
const App = ({ name }: { name: string }) => {
return (
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
<title>Waku example</title>
<h1>Hello {name}!!</h1>
<h3>This is a server component.</h3>
<Suspense fallback="Pending...">
Expand Down
4 changes: 2 additions & 2 deletions examples/02_async/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const rootElement = (
);

if ((globalThis as any).__WAKU_SSR_ENABLED__) {
hydrateRoot(document.getElementById('root')!, rootElement);
hydrateRoot(document.body, rootElement);
} else {
createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
}
37 changes: 0 additions & 37 deletions examples/03_promise/index.html

This file was deleted.

1 change: 1 addition & 0 deletions examples/03_promise/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const App = ({ name, children }: { name: string; children: ReactNode }) => {
});
return (
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
<title>Waku example</title>
<h1>Hello {name}!!</h1>
<h3>This is a server component.</h3>
<Counter delayedMessage={delayedMessage} />
Expand Down
4 changes: 2 additions & 2 deletions examples/03_promise/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const rootElement = (
);

if ((globalThis as any).__WAKU_SSR_ENABLED__) {
hydrateRoot(document.getElementById('root')!, rootElement);
hydrateRoot(document.body, rootElement);
} else {
createRoot(document.getElementById('root')!).render(rootElement);
createRoot(document.body).render(rootElement);
}
37 changes: 0 additions & 37 deletions examples/04_callserver/index.html

This file was deleted.

Loading

1 comment on commit 7c0a6ef

@vercel
Copy link

@vercel vercel bot commented on 7c0a6ef Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

waku – ./

waku-daishi.vercel.app
waku-git-main-daishi.vercel.app
waku.vercel.app
www.waku.gg
waku.gg

Please sign in to comment.