Skip to content

Commit

Permalink
Merge pull request #192 from wildmountainfarms/dev
Browse files Browse the repository at this point in the history
Updated `:web` dependencies
  • Loading branch information
retrodaredevil authored Dec 26, 2023
2 parents ac49536 + fc05610 commit 6b2d27d
Show file tree
Hide file tree
Showing 8 changed files with 24,857 additions and 15,179 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
Loading

0 comments on commit 6b2d27d

Please sign in to comment.