From d7069a8ad365b05fea7a38d49b230634835f2cac Mon Sep 17 00:00:00 2001 From: Matt <1009003+tantaman@users.noreply.github.com> Date: Sat, 13 Aug 2022 15:07:53 -0400 Subject: [PATCH] strict ts mode added a temporary any cast: https://github.com/tantaman/aphrodite/issues/45 --- .gitpod.yml | 2 +- package.json | 1 + pnpm-lock.yaml | 12 ++++++++---- src/index.tsx | 3 ++- tsconfig.json | 3 ++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 396b799..57c5a66 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,3 +1,3 @@ tasks: - init: npm install - command: npm run serve + command: npm run start diff --git a/package.json b/package.json index 544711f..1cbf5cb 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@aphro/absurd-sql-connector": "^0.2.1", "@aphro/react": "^1.1.0", "@aphro/runtime-ts": "^0.3.5", + "@types/react-dom": "^18.0.6", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b16f533..4e24807 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,7 @@ specifiers: '@aphro/react': ^1.1.0 '@aphro/runtime-ts': ^0.3.5 '@types/react': ^18.0.14 + '@types/react-dom': ^18.0.6 html-webpack-plugin: ^5.5.0 raw-loader: ^4.0.2 react: ^18.2.0 @@ -21,6 +22,7 @@ dependencies: '@aphro/absurd-sql-connector': 0.2.1 '@aphro/react': 1.1.0_frekgmicunnr4ohyckgunwlxbq '@aphro/runtime-ts': 0.3.5 + '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -503,7 +505,6 @@ packages: /@types/prop-types/15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - dev: true /@types/qs/6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} @@ -513,13 +514,18 @@ packages: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true + /@types/react-dom/18.0.6: + resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} + dependencies: + '@types/react': 18.0.14 + dev: false + /@types/react/18.0.14: resolution: {integrity: sha512-x4gGuASSiWmo0xjDLpm5mPb52syZHJx02VKbqUKdLmKtAwIh63XClGsiTI1K6DO5q7ox4xAsQrU+Gl3+gGXF9Q==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 csstype: 3.1.0 - dev: true /@types/retry/0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} @@ -527,7 +533,6 @@ packages: /@types/scheduler/0.16.2: resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} - dev: true /@types/serve-index/1.9.1: resolution: {integrity: sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==} @@ -1136,7 +1141,6 @@ packages: /csstype/3.1.0: resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} - dev: true /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} diff --git a/src/index.tsx b/src/index.tsx index af65d35..f73b1fd 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -11,6 +11,7 @@ import TodoList from "./domain/TodoList.js"; createResolver() .then((resolver) => { + // TODO: why did this type break? const ctx = context(anonymous(), resolver as any); start(ctx); }) @@ -41,6 +42,6 @@ async function setup(ctx: Context): Promise { async function start(ctx: Context) { const list = await setup(ctx); - const root = createRoot(document.getElementById("container")); + const root = createRoot(document.getElementById("container")!); root.render(); } diff --git a/tsconfig.json b/tsconfig.json index d576810..b786717 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "moduleResolution": "node", "rootDir": "./", "allowJs": true, - "jsx": "react" + "jsx": "react", + "strict": true }, "include": ["./src/"] }