Skip to content

Commit

Permalink
Updated as many dependencies as possible in :web
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Dec 26, 2023
1 parent a57675a commit 4320c5b
Show file tree
Hide file tree
Showing 8 changed files with 3,033 additions and 2,805 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ indent_style = space
indent_size = 4

# *.ns is for NotationScript
[{*.js, *.css, *.ts, *.tsx, *.jsx, *.graphql, *.ns}]
[{*.js,*.css,*.ts,*.tsx,*.jsx,*.graphql,*.ns}]
indent_style = space
indent_size = 2

Expand Down
4 changes: 4 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ bootBuildImage {
*/

processResources {
// TODO this dependsOn(":web:build") is also run for the generateSchema task,
// which can cause errors when :web:build may give errors.
// This is not ideal, especially when graphql.ts needs to be updated because it contains errors.
// If you have a problem with generateSchema in the future, consider temporarily commenting this line
dependsOn(":web:build")
from("$rootDir/web/build") {
into("static")
Expand Down
18 changes: 18 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,21 @@ This expects >= Node 16. NPM is used instead of yarn, which is why there is no `
This was created using `npx create-react-app web --template typescript` in the solarthing (root) directory.

To make IntelliJ play nice with a nvm install of npm, see https://stackoverflow.com/a/66730709/5434860.

### Dependency issues

This section keeps track of any dependency issues we are having:

* If we upgrade the `graphql-request` dependency to 6.1.0
* `@graphql-codegen/typescript-react-query` is not compatible
* https://github.com/dotansimha/graphql-code-generator-community/issues/367
* Temporary solution is to keep:
* `graphql-request` on 4.3.0
* `@graphql-codegen/typescript-graphql-request` on 4.5.9
* Newer versions would require a newer version of `graphql-request`
* `@tanstack/react-query` on 4.36.1
* Dependency-wise, nothing is stopping us from upgrading, but the resulting generated code is incompatible with newer versions
* Actual solution
* Because we don't want to upgrade to react-query v4, we're going to actually not upgrade those dependencies as described in the temporary solution
* `@graphql-codegen/typescript-react-query` needs to be on a v3.x.x release so that it uses a v3 react-query dependency during codegen. Otherwise there's nothing stopping us from updating this
* We specifically did not do the temporary solution because it broke `Login.tsx`. The same commit that is writing this is where we changed `Login.tsx` a tiny bit in an attempt to be more compatible with future dependency updates, but it still needs work
1 change: 1 addition & 0 deletions web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ tasks.register('appNpmBuild', NpmTask) {
}
tasks.register('generateCode', NpmTask) {
args = ["run", "graphql:codegen"]
// TODO (as commented in server/build.gradle), this dependsOn may cause :web:build to run, which is not always ideal
dependsOn(":server:generateSchema")
}

Expand Down
4,448 changes: 2,322 additions & 2,126 deletions web/package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@types/react-dom": "^18.2.18",
"graphiql": "^3.0.10",
"graphql": "^16.8.1",
"graphql-request": "^4.2.0",
"graphql-request": "^4.3.0",
"graphql-voyager": "^1.3.0",
"react": "^18.2.0",
"react-cookie": "^6.1.1",
Expand Down Expand Up @@ -43,14 +43,14 @@
]
},
"devDependencies": {
"@graphql-codegen/cli": "2.12.0",
"@graphql-codegen/introspection": "2.1.1",
"@graphql-codegen/typescript": "2.4.8",
"@graphql-codegen/typescript-document-nodes": "2.2.8",
"@graphql-codegen/typescript-graphql-files-modules": "2.1.1",
"@graphql-codegen/typescript-graphql-request": "^4.4.5",
"@graphql-codegen/typescript-operations": "^2.3.5",
"@graphql-codegen/typescript-react-query": "^3.5.9",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/introspection": "^4.0.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-document-nodes": "^4.0.1",
"@graphql-codegen/typescript-graphql-files-modules": "^3.0.0",
"@graphql-codegen/typescript-graphql-request": "^4.5.9",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-react-query": "^3.6.2",
"react-scripts": "5.0.1",
"shx": "^0.3.4"
}
Expand Down
Loading

0 comments on commit 4320c5b

Please sign in to comment.