-
Notifications
You must be signed in to change notification settings - Fork 117
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
Non reactive errors #2548
Non reactive errors #2548
Conversation
…tate, prepares removal of reactive errors property
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
inlang/source-code/editor/src/pages/@host/@owner/@repository/State.tsx
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
inlang/source-code/editor/src/pages/@host/@owner/@repository/State.tsx
Outdated
Show resolved
Hide resolved
Please elaborate. If you refer to exposing a "result" like type e.g. Supabase switching to result types supabase/supabase-js#32 got overwhelmingly downvotes after the change was merged. Counter proposals are happening supabase/supabase-js#885 to revert the change are happening too. In short, while EDIT: Following my "breaking compatibility" argument, maybe we should get rid of
cc @opral/inlang-sdk leaking result types to the consumer applies to inlang's message SDK too EDIT 2: ProposalRemove Making all functions that trigger side-effects async is required to make functions throw. I argue it's the right approach because a) functions with side effects are async by definition and b) error handling becomes easier. |
# Conflicts: # pnpm-lock.yaml
…penRepository doesn't fill errors anymore
@samuelstroschein Jan and I concluded this a the way to go yesterday. @janfjohannes please hop in with your thoughts as well on this on. My thoughts on this: DXJavascript is just broken when it comes to throwing errors. Why? We need a way to let the consumer know the cases to be handled. I agree on the standard part but the dx of just marking a function as The user of the lib will have to always look at the documentation and keep track of changes in errors a function can produce to be able to react to them vs having a compile time information about the errors that should be handled. I see the point of making a "throwing" version as suggested by the followup ticket in supabase but as long as lix is used internally we should focus on making a solid error handling and go for the returned error property that will Definitly help us define the error handling and communicate changes over the team (via typsaftynes). Inter Process communicationLix will most likely run in another process/thread/worker/deamon soon so we will have a interprocess communication going on between consumer and Excution and returning a Serializable result also including errors will be easier. Edit 1: |
@janfjohannes @martin-lysk I opened https://linear.app/opral/issue/INBOX-60/error-handling-in-lix-and-inlang-message-sdk. I don't understand your decision here. If we agree that compatibility issues will arise, a migration to throwing will come because users will complain as they do with supabase. |
# Conflicts: # inlang/source-code/editor/src/pages/@host/@owner/@repository/State.tsx # inlang/source-code/manage/src/components/InlangManage.ts
Lix currently returns a reactive property called
errors
. With this one Lix has 3 kinds of error handlings:This PR removes the second case for now and moves error collection logic to the thin layer using the lix SDK.
In the future we will have defined errors returned in the return object of a function called. (compare 3.) for errors that the client can react on and can deal with and throw for unexpected errors like asertation errors wrong url formats or state issues (file system has changed unexpectedly).