Skip to content

Commit

Permalink
chore: upgrade solid-start to 0.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed Jan 23, 2024
1 parent fe339f3 commit 314b074
Show file tree
Hide file tree
Showing 12 changed files with 12,683 additions and 8,149 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

dist
.solid
.vinxi
.output
.vercel
.netlify
Expand Down
20,659 changes: 12,596 additions & 8,063 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "siliwiz",
"license": "Apache-2.0",
"scripts": {
"dev": "solid-start dev",
"dev": "vinxi dev",
"lint": "eslint --ext .ts,.tsx .",
"build": "solid-start build",
"build": "vinxi build --preset static",
"build:element": "rollup --config rollup.config.mjs",
"format:check": "prettier --check **/*.{ts,js,css,tsx} !dist/** !node_modules/** !.solid/** !**/spice.js",
"start": "solid-start start",
"start": "vinxi start",
"postinstall": "patch-package",
"prepare": "husky install"
},
Expand All @@ -32,23 +32,20 @@
"lint-staged": "^13.1.0",
"patch-package": "^6.4.7",
"prettier": "^2.8.3",
"solid-start-node": "^0.3.5",
"typescript": "^4.9.5",
"vite": "^4.1.4"
},
"dependencies": {
"@solidjs/meta": "^0.29.1",
"@solidjs/router": "^0.8.3",
"@solidjs/start": "^0.4.10",
"@suid/icons-material": "^0.6.9",
"@suid/material": "^0.14.2",
"@types/plotly.js-basic-dist": "^1.54.1",
"json-beautify": "^1.1.1",
"plotly.js-basic-dist": "^2.15.1",
"solid-js": "^1.8.6",
"solid-js": "^1.8.12",
"solid-record": "^0.2.1",
"solid-start": "^0.3.10",
"three": "^0.149.0",
"undici": "^5.24.0"
"vinxi": "^0.1.4"
},
"lint-staged": {
"**/*.{ts,tsx}": [
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: Apache-2.0
// @refresh reload
import { clientOnly } from '@solidjs/start';
import './app.css';
import { loadPreset } from './model/layout';

export default function App() {
if (typeof location !== 'undefined') {
const urlParams = new URLSearchParams(location.search);
const preset = urlParams.get('preset');
if (preset != null) {
void import(`~/../presets/${preset}.json`).then((module) => {
if (module?.rects != null) {
loadPreset(module);
}
});
}
}

const Siliwiz = clientOnly(() => import('~/components/Siliwiz'));

return <Siliwiz />;
}
30 changes: 13 additions & 17 deletions src/components/Siliwiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { Box, CssBaseline, Stack, ThemeProvider } from '@suid/material';
import { Show } from 'solid-js';
import { ErrorBoundary, Scripts } from 'solid-start';
import MainView from '~/components/MainView';
import { theme } from '~/config/theme';
import { showSpice } from '~/model/spiceFile';
Expand All @@ -14,22 +13,19 @@ import SpiceCodeView from './SpiceCodeView';
export default function Siliwiz() {
return (
<ThemeProvider theme={theme}>
<ErrorBoundary>
<CssBaseline enableColorScheme />
<Header />
<Box sx={{ px: 2 }}>
<Stack spacing={1} width="max-content">
<MainView />
<Show when={showSpice()}>
<SpiceCodeView />
</Show>
<LinkBox />
</Stack>
<hr />
<Footer />
</Box>
</ErrorBoundary>
<Scripts />
<CssBaseline enableColorScheme />
<Header />
<Box sx={{ px: 2 }}>
<Stack spacing={1} width="max-content">
<MainView />
<Show when={showSpice()}>
<SpiceCodeView />
</Show>
<LinkBox />
</Stack>
<hr />
<Footer />
</Box>
</ThemeProvider>
);
}
4 changes: 2 additions & 2 deletions src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0

import { mount, StartClient } from 'solid-start/entry-client';
import { mount, StartClient } from '@solidjs/start/client';

mount(() => <StartClient />, document);
mount(() => <StartClient />, document.getElementById('app'));
29 changes: 27 additions & 2 deletions src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
// SPDX-License-Identifier: Apache-2.0

import { createHandler, renderAsync, StartServer } from 'solid-start/entry-server';
import { createHandler } from '@solidjs/start/entry';
import { StartServer } from '@solidjs/start/server';
import { AnalyticsScript } from './components/AnalyticsScript';

export default createHandler(renderAsync((event) => <StartServer event={event} />));
export default createHandler(() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
rel="stylesheet"
/>
{assets}
<AnalyticsScript />
</head>
<body>
<div id="app">{children}</div>
{scripts}
</body>
</html>
)}
/>
));
8 changes: 4 additions & 4 deletions src/model/stl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { STLExporter } from 'three/examples/jsm/exporters/STLExporter';
import { BoxGeometry } from 'three/src/geometries/BoxGeometry';
import { Group } from 'three/src/objects/Group';
import { Mesh } from 'three/src/objects/Mesh';
import { STLExporter } from 'three/examples/jsm/exporters/STLExporter.js';
import { BoxGeometry } from 'three/src/geometries/BoxGeometry.js';
import { Group } from 'three/src/objects/Group.js';
import { Mesh } from 'three/src/objects/Mesh.js';
import { downloadFile } from '~/utils/download-file';
import { layerTypes } from './layerTypes';
import { layout } from './layout';
Expand Down
40 changes: 0 additions & 40 deletions src/root.tsx

This file was deleted.

17 changes: 9 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"jsxImportSource": "solid-js",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"types": ["vite/client"],
"baseUrl": "./",
"jsxImportSource": "solid-js",
"allowJs": true,
"strict": true,
"noEmit": true,
"types": ["vinxi/client"],
"isolatedModules": true,
"resolveJsonModule": true,
"paths": {
"~/*": ["./src/*"]
}
Expand Down
5 changes: 2 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: Apache-2.0

import { defineConfig } from '@solidjs/start/config';
import suidPlugin from '@suid/vite-plugin';
import solid from 'solid-start/vite';
import { defineConfig } from 'vite';
import child from 'child_process';

const commitHash = child.execSync('git rev-parse --short HEAD').toString();
Expand All @@ -13,5 +12,5 @@ export default defineConfig({
__BUILD_TIME__: JSON.stringify(new Date().toISOString()),
},

plugins: [suidPlugin(), solid({ ssr: false })],
plugins: [suidPlugin()],
});

0 comments on commit 314b074

Please sign in to comment.