Skip to content
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

From Discord: TypeScript Code Issue After Updating to 3.0 #2593

Closed
effect-bot opened this issue Apr 22, 2024 · 0 comments · Fixed by #2595 or #2596
Closed

From Discord: TypeScript Code Issue After Updating to 3.0 #2593

effect-bot opened this issue Apr 22, 2024 · 0 comments · Fixed by #2595 or #2596
Assignees
Labels

Comments

@effect-bot
Copy link

Summary

The discussion revolves around a TypeScript code issue encountered after updating to version 3.0. The original code snippet provided by the first user attempts to define a function taggedStruct that uses generics and the pipe method to attach a property signature to a struct. However, this approach no longer works after the update.

The second user, gcanti, suggests an alternative approach that bypasses the problem by directly calling S.attachPropertySignature(S.Struct(fields), "_tag", name) instead of using the pipe method. This solution appears to resolve the issue at hand.

gcanti further identifies the root cause of the problem as an excessive constraint A extends object that is only present in the pipeable version of attachPropertySignature. They propose to address this issue by submitting a pull request (PR) to the relevant codebase.

Key Takeaways:

  • The update to version 3.0 introduced a breaking change affecting the use of pipe with attachPropertySignature.
  • A workaround involves directly calling attachPropertySignature with its arguments instead of using the pipe method.
  • The underlying issue was identified as an excessive type constraint in the pipeable version of attachPropertySignature.
  • A proactive approach to resolving the issue involves contributing a fix through a pull request to the library's repository.

Discord thread

https://discord.com/channels/795981131316985866/1231733088695091252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants