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

Update effect npm packages #5815

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Update effect npm packages #5815

merged 1 commit into from
Dec 6, 2024

Conversation

hash-worker[bot]
Copy link
Contributor

@hash-worker hash-worker bot commented Dec 6, 2024

This PR contains the following updates:

Package Type Update Change
@effect/platform (source) devDependencies patch 0.70.3 -> 0.70.4
@effect/platform-node (source) devDependencies patch 0.65.3 -> 0.65.4
effect (source) dependencies patch 3.11.2 -> 3.11.3

Release Notes

Effect-TS/effect (@​effect/platform)

v0.70.4

Compare Source

Patch Changes
Effect-TS/effect (@​effect/platform-node)

v0.65.4

Compare Source

Patch Changes
Effect-TS/effect (effect)

v3.11.3

Compare Source

Patch Changes
  • #​4080 90906f7 Thanks @​gcanti! - Fix the Schema.TemplateLiteral output type when the arguments include a branded type.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteral(
      "a ",
      Schema.String.pipe(Schema.brand("MyBrand"))
    )
    
    // type Type = `a ${Schema.brand<typeof Schema.String, "MyBrand"> & string}`
    // | `a ${Schema.brand<typeof Schema.String, "MyBrand"> & number}`
    // | `a ${Schema.brand<typeof Schema.String, "MyBrand"> & bigint}`
    // | `a ${Schema.brand<...> & false}`
    // | `a ${Schema.brand<...> & true}`
    type Type = typeof schema.Type

    After

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteral(
      "a ",
      Schema.String.pipe(Schema.brand("MyBrand"))
    )
    
    // type Type = `a ${string & Brand<"MyBrand">}`
    type Type = typeof schema.Type
  • #​4076 3862cd3 Thanks @​gcanti! - Schema: fix bug in Schema.TemplateLiteralParser resulting in a runtime error.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteralParser("a", "b")
    // throws TypeError: Cannot read properties of undefined (reading 'replace')

    After

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteralParser("a", "b")
    
    console.log(Schema.decodeUnknownSync(schema)("ab"))
    // Output: [ 'a', 'b' ]
  • #​4076 3862cd3 Thanks @​gcanti! - SchemaAST: fix TemplateLiteral model.

    Added Literal and Union as valid types.

  • #​4083 343b6aa Thanks @​gcanti! - Preserve MissingMessageAnnotations on property signature declarations when another field is a property signature transformation.

    Before

    import { Console, Effect, ParseResult, Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.propertySignature(Schema.String).annotations({
        missingMessage: () => "message1"
      }),
      b: Schema.propertySignature(Schema.String)
        .annotations({ missingMessage: () => "message2" })
        .pipe(Schema.fromKey("c")), // <= transformation
      d: Schema.propertySignature(Schema.String).annotations({
        missingMessage: () => "message3"
      })
    })
    
    Effect.runPromiseExit(
      Schema.decodeUnknown(schema, { errors: "all" })({}).pipe(
        Effect.tapError((error) =>
          Console.log(ParseResult.ArrayFormatter.formatErrorSync(error))
        )
      )
    )
    /*
    Output:
    [
      { _tag: 'Missing', path: [ 'a' ], message: 'is missing' }, // <= wrong
      { _tag: 'Missing', path: [ 'c' ], message: 'message2' },
      { _tag: 'Missing', path: [ 'd' ], message: 'is missing' } // <= wrong
    ]
    */

    After

    import { Console, Effect, ParseResult, Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.propertySignature(Schema.String).annotations({
        missingMessage: () => "message1"
      }),
      b: Schema.propertySignature(Schema.String)
        .annotations({ missingMessage: () => "message2" })
        .pipe(Schema.fromKey("c")), // <= transformation
      d: Schema.propertySignature(Schema.String).annotations({
        missingMessage: () => "message3"
      })
    })
    
    Effect.runPromiseExit(
      Schema.decodeUnknown(schema, { errors: "all" })({}).pipe(
        Effect.tapError((error) =>
          Console.log(ParseResult.ArrayFormatter.formatErrorSync(error))
        )
      )
    )
    /*
    Output:
    [
      { _tag: 'Missing', path: [ 'a' ], message: 'message1' },
      { _tag: 'Missing', path: [ 'c' ], message: 'message2' },
      { _tag: 'Missing', path: [ 'd' ], message: 'message3' }
    ]
    */
  • #​4081 afba339 Thanks @​gcanti! - Fix the behavior of Schema.TemplateLiteralParser when the arguments include literals other than string literals.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteralParser(Schema.String, 1)
    
    console.log(Schema.decodeUnknownSync(schema)("a1"))
    /*
    throws
    ParseError: (`${string}1` <-> readonly [string, 1])
    └─ Type side transformation failure
       └─ readonly [string, 1]
          └─ [1]
             └─ Expected 1, actual "1"
    */

    After

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteralParser(Schema.String, 1)
    
    console.log(Schema.decodeUnknownSync(schema)("a1"))
    // Output: [ 'a', 1 ]

Configuration

📅 Schedule: Branch creation - "before 4am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@hash-worker hash-worker bot enabled auto-merge December 6, 2024 00:28
@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Dec 6, 2024
Copy link
Contributor

github-actions bot commented Dec 6, 2024

Benchmark results

@rust/hash-graph-benches – Integrations

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$16.9 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{lightgreen}-29.496 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$17.8 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}3.48 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$16.7 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{gray}-1.004 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$17.6 \mathrm{ms} \pm 197 \mathrm{μs}\left({\color{gray}0.438 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$17.5 \mathrm{ms} \pm 226 \mathrm{μs}\left({\color{gray}-0.687 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$17.0 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}-2.530 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$16.5 \mathrm{ms} \pm 161 \mathrm{μs}\left({\color{gray}-4.697 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$17.4 \mathrm{ms} \pm 199 \mathrm{μs}\left({\color{lightgreen}-20.953 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$17.5 \mathrm{ms} \pm 229 \mathrm{μs}\left({\color{gray}-0.419 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property depths: DT=255, PT=255, ET=255, E=255 $$66.8 \mathrm{ms} \pm 216 \mathrm{μs}\left({\color{gray}-1.364 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$40.2 \mathrm{ms} \pm 115 \mathrm{μs}\left({\color{gray}-0.271 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$57.5 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{gray}-1.511 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$44.2 \mathrm{ms} \pm 193 \mathrm{μs}\left({\color{gray}-0.495 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.8 \mathrm{ms} \pm 263 \mathrm{μs}\left({\color{gray}-1.164 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.6 \mathrm{ms} \pm 264 \mathrm{μs}\left({\color{gray}0.041 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$111 \mathrm{ms} \pm 404 \mathrm{μs}\left({\color{gray}-1.131 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$43.8 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{gray}-1.377 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$102 \mathrm{ms} \pm 347 \mathrm{μs}\left({\color{gray}-0.934 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$83.5 \mathrm{ms} \pm 522 \mathrm{μs}\left({\color{gray}-0.943 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$93.0 \mathrm{ms} \pm 432 \mathrm{μs}\left({\color{gray}-1.962 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$97.7 \mathrm{ms} \pm 386 \mathrm{μs}\left({\color{gray}-2.360 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 $$1.39 \mathrm{ms} \pm 3.66 \mathrm{μs}\left({\color{gray}-0.809 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$5.22 \mathrm{s} \pm 831 \mathrm{ms}\left({\color{gray}-0.076 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$26.4 \mathrm{ms} \pm 116 \mathrm{μs}\left({\color{gray}-0.869 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.2 \mathrm{ms} \pm 103 \mathrm{μs}\left({\color{gray}-2.295 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$56.8 \mathrm{ms} \pm 288 \mathrm{μs}\left({\color{red}11.3 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$176 \mathrm{ms} \pm 505 \mathrm{μs}\left({\color{gray}-3.131 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$1.92 \mathrm{ms} \pm 4.91 \mathrm{μs}\left({\color{gray}-1.390 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.12 \mathrm{ms} \pm 7.22 \mathrm{μs}\left({\color{gray}-0.206 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$1.99 \mathrm{ms} \pm 5.55 \mathrm{μs}\left({\color{gray}1.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.86 \mathrm{ms} \pm 11.7 \mathrm{μs}\left({\color{gray}-1.572 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$14.0 \mathrm{ms} \pm 49.0 \mathrm{μs}\left({\color{gray}-1.770 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$5.12 \mathrm{ms} \pm 45.6 \mathrm{μs}\left({\color{gray}-0.318 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.97 \mathrm{ms} \pm 12.0 \mathrm{μs}\left({\color{gray}-0.356 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.93 \mathrm{ms} \pm 9.01 \mathrm{μs}\left({\color{gray}-0.469 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.10 \mathrm{ms} \pm 11.2 \mathrm{μs}\left({\color{gray}-3.804 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$2.74 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}-1.414 \mathrm{\%}}\right) $$ Flame Graph

Merged via the queue into main with commit 4c6bbee Dec 6, 2024
166 of 167 checks passed
@hash-worker hash-worker bot deleted the deps/js/effect-npm-packages branch December 6, 2024 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team
Development

Successfully merging this pull request may close these issues.

1 participant