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

add Serializable docs #3148

Merged
merged 4 commits into from
Jul 4, 2024
Merged

add Serializable docs #3148

merged 4 commits into from
Jul 4, 2024

Conversation

gcanti
Copy link
Contributor

@gcanti gcanti commented Jul 3, 2024

No description provided.

@gcanti gcanti added documentation Improvements or additions to documentation schema labels Jul 3, 2024
Copy link

changeset-bot bot commented Jul 3, 2024

🦋 Changeset detected

Latest commit: 1c5c649

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@effect/schema Patch
@effect/cli Patch
@effect/cluster-browser Patch
@effect/cluster-node Patch
@effect/cluster-workflow Patch
@effect/cluster Patch
@effect/experimental Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/platform Patch
@effect/rpc-http Patch
@effect/rpc Patch
@effect/sql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-node Patch
@effect/sql-drizzle Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gcanti gcanti marked this pull request as ready for review July 4, 2024 16:43
@gcanti gcanti merged commit 359ff8a into main Jul 4, 2024
12 checks passed
@gcanti gcanti deleted the schema-readme-serializable branch July 4, 2024 16:50
@github-actions github-actions bot mentioned this pull request Jul 4, 2024
suddenlyGiovanni added a commit to suddenlyGiovanni/resume that referenced this pull request Sep 3, 2024
- [#3192](Effect-TS/effect#3192) [`5d5cc6c`](Effect-TS/effect@5d5cc6c) Thanks @KhraksMamtsov! - Support `Capitalize` `Uncapitalize` filters and schemas

- [#3148](Effect-TS/effect#3148) [`359ff8a`](Effect-TS/effect@359ff8a) Thanks @gcanti! - add `Serializable.Serializable.Type` and `Serializable.Serializable.Encoded`

- [#3198](Effect-TS/effect#3198) [`f7534b9`](Effect-TS/effect@f7534b9) Thanks @gcanti! - Add `toString` to `AST.PropertySignature` and `AST.IndexSignature` and fix type display for IndexSignature.

  **Before the Change**

  Previously, when a type mismatch occurred in `Schema.decodeUnknownSync`, the error message displayed for `IndexSignature` was not accurately representing the type used. For example:

  ```typescript
  import { Schema } from "@effect/schema"

  const schema = Schema.Record(Schema.Char, Schema.String)

  Schema.decodeUnknownSync(schema)({ a: 1 })
  /*
  throws
  ParseError: { readonly [x: string]: string }
  └─ ["a"]
     └─ Expected string, actual 1
  */
  ```

  This output incorrectly indicated `[x: string]` when the actual index type was `Char`.

  **After the Change**

  The `toString` implementation now correctly reflects the type used in `IndexSignature`, providing more accurate and informative error messages:

  ```ts
  import { Schema } from "@effect/schema"

  const schema = Schema.Record(Schema.Char, Schema.String)

  Schema.decodeUnknownSync(schema)({ a: 1 })
  /*
  throws
  ParseError: { readonly [x: Char]: string }
  └─ ["a"]
     └─ Expected string, actual 1
  */
  ```

  The updated output now correctly displays `{ readonly [x: Char]: string }`, aligning the error messages with the actual data types used in the schema.

- Updated dependencies [[`a435e0f`](Effect-TS/effect@a435e0f), [`b5554db`](Effect-TS/effect@b5554db), [`a9c4fb3`](Effect-TS/effect@a9c4fb3)]:
  - effect@3.4.8

Signed-off-by: Giovanni Ravalico <15946771+suddenlyGiovanni@users.noreply.github.com>
suddenlyGiovanni added a commit to suddenlyGiovanni/resume that referenced this pull request Sep 3, 2024
- [#3192](Effect-TS/effect#3192) [`5d5cc6c`](Effect-TS/effect@5d5cc6c) - Support `Capitalize` `Uncapitalize` filters and schemas

- [#3148](Effect-TS/effect#3148) [`359ff8a`](Effect-TS/effect@359ff8a) - add `Serializable.Serializable.Type` and `Serializable.Serializable.Encoded`

- [#3198](Effect-TS/effect#3198) [`f7534b9`](Effect-TS/effect@f7534b9) - Add `toString` to `AST.PropertySignature` and `AST.IndexSignature` and fix type display for IndexSignature.

  **Before the Change**

  Previously, when a type mismatch occurred in `Schema.decodeUnknownSync`, the error message displayed for `IndexSignature` was not accurately representing the type used. For example:

  ```typescript
  import { Schema } from "@effect/schema"

  const schema = Schema.Record(Schema.Char, Schema.String)

  Schema.decodeUnknownSync(schema)({ a: 1 })
  /*
  throws
  ParseError: { readonly [x: string]: string }
  └─ ["a"]
     └─ Expected string, actual 1
  */
  ```

  This output incorrectly indicated `[x: string]` when the actual index type was `Char`.

  **After the Change**

  The `toString` implementation now correctly reflects the type used in `IndexSignature`, providing more accurate and informative error messages:

  ```ts
  import { Schema } from "@effect/schema"

  const schema = Schema.Record(Schema.Char, Schema.String)

  Schema.decodeUnknownSync(schema)({ a: 1 })
  /*
  throws
  ParseError: { readonly [x: Char]: string }
  └─ ["a"]
     └─ Expected string, actual 1
  */
  ```

  The updated output now correctly displays `{ readonly [x: Char]: string }`, aligning the error messages with the actual data types used in the schema.

- Updated dependencies [[`a435e0f`](Effect-TS/effect@a435e0f), [`b5554db`](Effect-TS/effect@b5554db), [`a9c4fb3`](Effect-TS/effect@a9c4fb3)]:
  - effect@3.4.8

Signed-off-by: Giovanni Ravalico <15946771+suddenlyGiovanni@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation schema
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant