-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating to Latest Dependencies Rescript version 11, Rescript/React version 12 #156
Conversation
I wonder if |
Sorry, totally missed notifications on this. This is really all we need? That would be great. That was my initial hope, but haven't looked into it in a while. Have you tried running the examples directory with this? |
hello! just chiming in to say that I have a project that relies heavily on this library and this is the last dependency preventing us from upgrading to Rescript 11. as of right now there's just one error related to currying I can't seem to get around even with changes made in this PR: FAILED: src/ApolloClient__Utils.cmj
We've found a bug for you!
/<project directory>/client/node_modules/rescript-apollo-client/src/ApolloClient__Utils.res:11:72-15:3
9 │ external asJson: 'any => Js.Json.t = "%identity"
10 │
11 │ let safeParse: ('jsData => 'data) => Types.safeParse<'data, 'jsData> =
│ (parse, jsData) =>
12 │ switch parse(jsData) {
13 │ | data => Ok(data)
14 │ | exception Js.Exn.Error(error) => Error({value: jsData->asJson, erro
│ r: error})
15 │ }
16 │
17 │ let safeParseAndLiftToCommonResultProps: (
This function expected 1 argument, but got 2 @jeddeloh I know you don't really maintain this library anymore, any thoughts on maintenance or drop-in alternatives? just wondering what the future of this library is/trying to avoid doing too much rework on my project 🙂 |
@zatchheems Yeah, I'm not really maintaining this anymore, but I'm very happy to help anyone that would like to take a stab at this. With the error you're getting, how sure are you that this isn't just the first error into a cascade of errors until the library has been converted to uncurried? If you're getting an error at all, I assume it means that just simply setting @zatchheems have you tried just going through and converting stuff to uncurried? I really doubt it would take all that long. |
not sure at all! I tested it very briefly so it's likely just the first thread I'll need to pull. I took a look at #153 which seems to have addressed much of converting stuff to uncurried (Edit: or at least til that branch was force-pushed and those commits disappeared). I can take a crack at it. |
That is unfortunate. If I remember correctly, it was indeed basically done. @AlexMoutonNoble do you know what happened there? |
Hi Joel Happy to help too as I can, but will be largely out of contact for the next week or more. |
just to keep this conversation moving, I have been slowly making my way through the necessary updates. I'll create my own PR when that's ready. one q: I've copied the |
Awesome! I think we can forget about backwards compatibility at this point and just shoot for a new major version. There's nothing no new features coming in the near future so people can always just stay on an older version if necessary. Also, sorry for the slow reply and heads up that I'm going in for surgery tomorrow so may be a bit slow to respond this week. |
@jeddeloh one last hurdle before I open a new PR: I've been trying to make sense of uncurrying calls to earlier in the file, I uncurried the call like so: let onClearStore = t => (~cb) => jsClient->Js_.onClearStore(t, ~cb) a record is passed as the second argument to //<user path>/src/@apollo/client/core/ApolloClient__Core_ApolloClient.res:1064:7-18
1062 ┆ extract,
1063 ┆ mutate,
1064 ┆ onClearStore, <--
1065 ┆ onResetStore,
1066 ┆ query,
This function expected 2 arguments, but got 1 this will likely be the same issue for |
@zatchheems If you haven't fixed this already--it looks like this stems from the trailing @send
external onClearStore: (t, ~cb: unit => Js.Promise.t<unit>, unit) => unit = "onClearStore" I am also at a point where this library is one of the last I need to get updated for |
I had a feeling that changing out the internals to explict uncurried functions would work: illusionalsagacity#3 This branch will compile
You have to set this ppx-flag for
The branch is based on my |
@illusionalsagacity at this point it looks like we've duplicated this work—my changes seem very similar except I opted to explicitly uncurry, with one of the advantages being there are no master...zatchheems:rescript-apollo-client:main still testing it and ironing out the kinks. to be completely honest, I'm not sure which approach is preferable! |
Sorry for such a late reply (my recovery did not go so well 😅). I guess I would not be not too concerned about backwards compatibility at this point since we're not really adding any new features that someone on an old codebase wouldn't have access to. Given that, if the work has already been done to explicitly uncurry this library it's preferable to go with that? Thoughts? |
Sorry to hear that, hope things are going better now though
My feeling is that it would make it somewhat easier to upgrade with a technically breaking change that still worked with curried mode if there were other libraries that needed updates still. I'm not firmly attached to this so considering the extra work involved with publishing two versions... (one with explicit uncurried syntax and another with turning uncurried: true on) 🤷 |
That's somewhat compelling for the near-term. Are you suggesting we publish one after the other or maintain two versions for a bit? |
The former yeah. The second publish should be essentially no work as turning on uncurried and running the formatter will print away the The branch I have now compiles for both ReScript 10 and ReScript 11 with uncurried off. I smoke-tested against the app I'm trying to upgrade and I didn't have to make any changes for ReScript 10. Unfortunately I can't verify on ReScript 11 (curried) since I have one dependency that was using the Reason syntax, and when that got moved to the ReScript syntax it also moved to the uncurried syntax exclusively. I did load up EXAMPLES (by merging #158 into that branch) on ReScript 11 curried and it works. However, I'm still getting this graphql-ppx fragment module signature problem both on my branch and on @zatchheems' (after updating @reasonml-community/[email protected] and [email protected])
|
I was getting a different error while testing an uncurried project and this
looks similar. going out of town and leaving my laptop but will be back
with fresh eyes next week.
I am all for a temporary uncurried off solution and moving to fully
uncurried later. excited to see this moving!
…On Wed, Oct 9, 2024, 21:54 illusionalsagacity ***@***.***> wrote:
That's somewhat compelling for the near-term. Are you suggesting we
publish one after the other or maintain two versions for a bit?
The former yeah. The second publish should be essentially no work as
turning on uncurried and running the formatter will print away the (. )
syntax.
The branch I have now compiles for both ReScript 10 and ReScript 11 with
uncurried off. I smoke-tested against the app I'm trying to upgrade and I
didn't have to make any changes for ReScript 10. Unfortunately I can't
verify on ReScript 11 (curried) since I have one dependency that was using
the Reason syntax, and when that got moved to the ReScript syntax it also
moved to the uncurried syntax exclusively. I did load up EXAMPLES (by
merging #158 <#158>
into that branch) on ReScript 11 curried and it works.
------------------------------
However, I'm still getting this graphql-ppx fragment module signature
problem both on my branch and on @zatchheems
<https://github.com/zatchheems>'
FAILED: src/hooksUsage/Query_OverlySimple.cmj
We've found a bug for you!
/src/github.com/zatchheems/rescript-apollo-client/EXAMPLES/src/hooksUsage/Query_OverlySimple.res
Signature mismatch:
...
Values do not match:
let parse: Raw.t => t (curried)
is not included in
let parse: Raw.t => t (uncurried)
/src/github.com/zatchheems/rescript-apollo-client/src/ApolloClient__Types.res:27:3-23:
Expected declaration
/src/github.com/zatchheems/rescript-apollo-client/EXAMPLES/src/hooksUsage/Query_OverlySimple.res:
Actual declaration
—
Reply to this email directly, view it on GitHub
<#156 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA43TPZDQOP6FNSPCVZ6KDZ2XT6XAVCNFSM6AAAAABKYCOF6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBTHAZTMNZYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The So the branch works with EXAMPLES in the following dependency combinations:
EXAMPLES doesn't seem to have full code coverage of the package though |
Awesome. Yeah, sadly, examples only covers pretty basic usage. Do we want to start merging stuff in and publish some pre release packages. I assume we want to merge #155 in first still? |
I've whipped up a draft PR for the second phase of this upgrade: #159 note that I'm having trouble getting the EXAMPLES to work. (this is a me problem but I stand by the work I've done thus far!) |
@illusionalsagacity So we're just waiting on your ppx changes to land before we can merge this, right? |
Or do you want to PR your |
Closing in favor of #160 |
Updated to latest versions
@apollo/client: 3.5.0 -> 3.10.8
@reasonml-community/graphql-ppx: 1.0.0 -> 1.2.3
@rescript/react: 0.11.0 -> 0.12.2
rescript: 10.1.2 -> 11.1.2
graphql: 14.0.0 -> 16.9.0
react: 18.2.0 -> 18.3.1
react-dom: 18.2.0 -> 18.3.1
Breaking change was new rescript uncurried mode, should be backward compatible.