Skip to content

Commit

Permalink
✨ HMR is here!
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Feb 20, 2021
1 parent 3a22b85 commit 949f7e1
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 141 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,24 @@
"vite": "^2"
},
"dependencies": {
"@babel/core": "^7.12.16",
"@babel/preset-typescript": "^7.12.16",
"@babel/core": "^7.12.17",
"@babel/preset-typescript": "^7.12.17",
"babel-preset-solid": "^0.24.2",
"resolve.exports": "^1.0.2",
"solid-js": "^0.24.7",
"vite": "^2.0.0"
"vite": "^2.0.1"
},
"devDependencies": {
"@babel/plugin-transform-typescript": "^7.12.16",
"@babel/plugin-transform-typescript": "^7.12.17",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@skypack/package-check": "^0.2.2",
"@types/babel__core": "^7.1.12",
"@types/node": "^14.14.28",
"@types/node": "^14.14.31",
"prettier": "^2.2.1",
"rollup": "^2.39.0",
"rollup-plugin-cleaner": "^1.0.0",
"solid-refresh": "^0.0.1",
"typescript": "^4.1.5"
}
}
12 changes: 3 additions & 9 deletions playground/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createSignal, lazy } from 'solid-js';
import { Link } from 'solid-app-router';
import { MetaProvider } from 'solid-meta';
import { Router, Route, RouteDefinition } from 'solid-app-router';
import { createApp } from 'solid-utils';
import { Router, Route, RouteDefinition, Link } from 'solid-app-router';

import Home from './pages';

Expand All @@ -25,14 +24,9 @@ const App = () => {
<Link href="/">Home</Link>
<Link href="/about">About!!!</Link>
<Route />
<button onClick={() => setCount(count() + 1)}>{count()}</button>
<button onClick={() => setCount(count() + 1)}>{count()}!!!!</button>
</>
);
};

const dispose = createApp(App).use(MetaProvider).use(Router, { routes }).mount('#app');

if (import.meta.hot) {
import.meta.hot.accept();
import.meta.hot.dispose(dispose);
}
createApp(App).use(MetaProvider).use(Router, { routes }).mount('#app');
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"license": "MIT",
"devDependencies": {
"vite": "^2.0.0"
"vite": "^2.0.1"
},
"dependencies": {
"solid-app-router": "^0.0.23",
Expand Down
6 changes: 4 additions & 2 deletions playground/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export default function About() {
return <h1>Hello about</h1>;
export function About() {
return <h1>Hello About</h1>;
}

export default About;
13 changes: 4 additions & 9 deletions playground/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Title } from 'solid-meta';

export default function Home() {
return (
<>
<Title>Home!!!</Title>
<h1>Hello home</h1>
</>
);
function Home() {
return <h1>Hello home</h1>;
}

export default Home;
14 changes: 7 additions & 7 deletions playground/pnpm-lock.yaml

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

Loading

0 comments on commit 949f7e1

Please sign in to comment.