Skip to content

Commit

Permalink
chore!: remove react render
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Mar 13, 2023
1 parent 47bff2a commit e7a97c1
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 89 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ yarn start:ws
ws-url=""
room-id=""
language=""
read-only
no-join
no-share
no-leave
read-only="true"
no-join="true"
no-share="true"
no-leave="true"
/>
```

Expand Down
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/multer": "^1.4.7",
"@types/node": "^18.15.0",
"@types/node": "^18.15.1",
"nodemon": "^2.0.21",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.2",
Expand Down
4 changes: 0 additions & 4 deletions client/.env.example

This file was deleted.

9 changes: 8 additions & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
<title>tldraw</title>
</head>
<body>
<div id="root"></div>
<div class="tldraw">
<tldraw-editor
idb-name="my-tldraw-editor"
api-url="http://localhost:8080"
ws-url="ws://localhost:1234/ws"
language="fr"
/>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
9 changes: 5 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
"axios": "^1.3.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.58.3",
"react-hotkeys-hook": "^4.3.8",
"sass": "^1.59.2",
"uuid": "^9.0.0",
"y-presence": "^0.2.3",
"y-websocket": "^1.4.6",
"yjs": "^13.5.49"
"y-websocket": "^1.5.0",
"yjs": "^13.5.50"
},
"devDependencies": {
"@types/node": "^18.15.0",
"@types/node": "^18.15.1",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/uuid": "^9.0.1",
Expand Down
21 changes: 0 additions & 21 deletions client/src/App.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions client/src/App.scss → client/src/assets/scss/editor.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

a {
color: inherit;
text-decoration: none;
}

* {
box-sizing: border-box;
}

.tldraw {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
}

$border-radius: 9px;
$height: 40px;

Expand Down
26 changes: 26 additions & 0 deletions client/src/assets/scss/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

a {
color: inherit;
text-decoration: none;
}

* {
box-sizing: border-box;
}

.tldraw {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
}
5 changes: 4 additions & 1 deletion client/src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import MultiplayerEditor from "./MultiplayerEditor";
import SingleplayerEditor from "./SingleplayerEditor";
import "../assets/scss/editor.scss";

type Settings = {
idbName: string;
apiUrl: string;
wsUrl?: string;
roomId?: string;
readOnly?: boolean;
language?: string;
readOnly?: boolean;
noJoin?: boolean;
noLeave?: boolean;
noShare?: boolean;
Expand Down Expand Up @@ -57,6 +58,7 @@ function Editor({

language = language || "en";
readOnly = readOnly || false;

let editor = (
<SingleplayerEditor
apiUrl={apiUrl}
Expand All @@ -66,6 +68,7 @@ function Editor({
readOnly={wantJoinRoom}
/>
);

if (wsUrl && room && uuidValidate(room)) {
let doc = newDoc();
if (useLocalDoc) doc = cloneDoc(localDoc);
Expand Down
10 changes: 1 addition & 9 deletions client/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./assets/scss/main.scss";

import "./ce";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"client"
],
"scripts": {
"initialize": "yarn && cp ./api/.env.example ./api/.env && cp ./client/.env.example ./client/.env",
"initialize": "yarn && cp api/.env.example api/.env",
"clean": "find . -name node_modules -o -name dist -type d | xargs rm -rf",
"dev": "concurrently -n WS,API,Client \"yarn start:ws\" \"yarn dev:api\" \"yarn dev:client\"",
"dev:api": "yarn workspace api dev",
Expand Down
37 changes: 21 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.2.tgz#c076ed1d7b6095078ad3cf21dfeea951842778b1"
integrity sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==

"@types/node@^18.15.0":
version "18.15.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.0.tgz#286a65e3fdffd691e170541e6ecb0410b16a38be"
integrity sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==
"@types/node@^18.15.1":
version "18.15.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.1.tgz#41dc2bf78e8085a250d4670d95edb7fba621dd29"
integrity sha512-U2TWca8AeHSmbpi314QBESRk7oPjSZjDsR+c+H4ECC1l+kFgpZf8Ydhv3SJpPy51VyZHHqxlb6mTTqYNNRVAIw==

"@types/prop-types@*":
version "15.7.5"
Expand Down Expand Up @@ -2785,6 +2785,11 @@ react-hotkeys-hook@^3.4.7:
dependencies:
hotkeys-js "3.9.4"

react-hotkeys-hook@^4.3.8:
version "4.3.8"
resolved "https://registry.yarnpkg.com/react-hotkeys-hook/-/react-hotkeys-hook-4.3.8.tgz#75fa18e7edb393c2d308a59378932c6badf94b80"
integrity sha512-RmrIQ3M259c84MnYVEAQsmHkD6s7XUgLG0rW6S7qjt1Lh7q+SPIz5b6obVU8OJw1Utsj1mUCj6twtBPaK/ytww==

react-intl@^6.1.1:
version "6.2.10"
resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-6.2.10.tgz#586ba261b3ff67be09072fefdee2ef58497e0ea2"
Expand Down Expand Up @@ -2961,10 +2966,10 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

sass@^1.58.3:
version "1.58.3"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.58.3.tgz#2348cc052061ba4f00243a208b09c40e031f270d"
integrity sha512-Q7RaEtYf6BflYrQ+buPudKR26/lH+10EmO9bBqbmPh/KeLqv8bjpTNqxe71ocONqXq+jYiCbpPUmQMS+JJPk4A==
sass@^1.59.2:
version "1.59.2"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.59.2.tgz#537f6d11614d4f20f97696f23ad358ee398b1937"
integrity sha512-jJyO6SmbzkJexF8MUorHx5tAilcgabioYxT/BHbY4+OvoqmbHxsYlrjZ8Adhqcgl6Zqwie0TgMXLCAmPFxXOuw==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
Expand Down Expand Up @@ -3449,10 +3454,10 @@ y-protocols@^1.0.5:
dependencies:
lib0 "^0.2.42"

y-websocket@^1.4.6:
version "1.4.6"
resolved "https://registry.yarnpkg.com/y-websocket/-/y-websocket-1.4.6.tgz#61499fe7df63179ed2ba5a525a1514dfb406264c"
integrity sha512-QAmFPlcjUWbdtueMjP/z7CpIJ3pyQbBiPsXyjeeXfSF5VJwV7aqlbU16a0YOsiSQwHCeLO8N2mYs8WsrKfmE7A==
y-websocket@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/y-websocket/-/y-websocket-1.5.0.tgz#3c13ed205f1553185e1d144eac94150b5b5d55d6"
integrity sha512-A8AO6XtnQlYwWFytWdkDCeXg4l8ghRTIw5h2YUgUYDmEC9ugWGIwYNW80yadhSFAF7CvuWTEkQNEpevnH6EiZw==
dependencies:
lib0 "^0.2.52"
lodash.debounce "^4.0.8"
Expand Down Expand Up @@ -3494,10 +3499,10 @@ yargs@^17.3.1:
y18n "^5.0.5"
yargs-parser "^21.1.1"

yjs@^13.5.49:
version "13.5.49"
resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.5.49.tgz#09978e912b877aaae0b069d4df22179fa858edec"
integrity sha512-qfQGf8ninOMpOgHkZxLXQOVeLiE9bWiZbwWTkMptFRlNzq9n6Zg3u8XtDFXWf9kv0gXhW4KHEBmHXoGYFEOT3w==
yjs@^13.5.50:
version "13.5.50"
resolved "https://registry.yarnpkg.com/yjs/-/yjs-13.5.50.tgz#ab0605c677922163c9fe49295d3fd47c04c8e0e9"
integrity sha512-Q2KVNfovwjtJV4Yxz+HaFYT6vTYBaFagOSpTL3jbPc7Sbv/My68fLTfPlYy9FmNO87pV8dMBd5XuVar+9WsAWg==
dependencies:
lib0 "^0.2.49"

Expand Down

0 comments on commit e7a97c1

Please sign in to comment.