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 #5915

Merged
merged 1 commit into from
Dec 14, 2024
Merged

Update effect npm packages #5915

merged 1 commit into from
Dec 14, 2024

Conversation

hash-worker[bot]
Copy link
Contributor

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

This PR contains the following updates:

Package Type Update Change
@effect/platform (source) devDependencies minor 0.70.7 -> 0.71.2
@effect/platform-node (source) devDependencies minor 0.65.7 -> 0.66.2
effect (source) dependencies patch 3.11.5 -> 3.11.7

Release Notes

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

v0.71.2

Compare Source

Patch Changes
  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: handle the nullable keyword for OpenAPI target, closes #​4075.

    Before

    import { OpenApiJsonSchema } from "@​effect/platform"
    import { Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "enum": [
            null
          ]
        }
      ]
    }
    */

    After

    import { OpenApiJsonSchema } from "@​effect/platform"
    import { Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
      "type": "string",
      "nullable": true
    }
    */
  • #​4128 8d978c5 Thanks @​gcanti! - JSONSchema: add type for homogeneous enum schemas, closes #​4127

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Literal("a", "b")
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "enum": [
        "a",
        "b"
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Literal("a", "b")
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "enum": [
        "a",
        "b"
      ]
    }
    */
  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: use { "type": "null" } to represent the null literal

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "enum": [
            null
          ]
        }
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
    */
  • Updated dependencies [2408616, cec0b4d, cec0b4d, 8d978c5, cec0b4d, cec0b4d]:

    • effect@3.11.7

v0.71.1

Compare Source

Patch Changes
  • #​4132 1d3df5b Thanks @​tim-smart! - allow passing Context to HttpApp web handlers

    This allows you to pass request-scoped data to your handlers.

    import { Context, Effect } from "effect"
    import { HttpApp, HttpServerResponse } from "@​effect/platform"
    
    class Env extends Context.Reference<Env>()("Env", {
      defaultValue: () => ({ foo: "bar" })
    }) {}
    
    const handler = HttpApp.toWebHandler(
      Effect.gen(function* () {
        const env = yield* Env
        return yield* HttpServerResponse.json(env)
      })
    )
    
    const response = await handler(
      new Request("http://localhost:3000/"),
      Env.context({ foo: "baz" })
    )
    
    assert.deepStrictEqual(await response.json(), {
      foo: "baz"
    })

v0.71.0

Compare Source

Minor Changes
  • #​4129 c99a0f3 Thanks @​tim-smart! - replace HttpApi.empty with HttpApi.make(identifier)

    This ensures if you have multiple HttpApi instances, the HttpApiGroup's are
    implemented correctly.

    import { HttpApi } from "@&#8203;effect/platform"
    
    // Before
    class Api extends HttpApi.empty.add(...) {}
    
    // After
    class Api extends HttpApi.make("api").add(...) {}
Patch Changes
Effect-TS/effect (@​effect/platform-node)

v0.66.2

Compare Source

Patch Changes

v0.66.1

Compare Source

Patch Changes

v0.66.0

Compare Source

Patch Changes
Effect-TS/effect (effect)

v3.11.7

Compare Source

Patch Changes
  • #​4137 2408616 Thanks @​gcanti! - Arbitrary: fix bug where refinements in declarations raised an incorrect missing annotation error, closes #​4136

  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: ignore never members in unions.

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Union(Schema.String, Schema.Never)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$id": "/schemas/never",
          "not": {},
          "title": "never"
        }
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Union(Schema.String, Schema.Never)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string"
    }
    */
  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: handle the nullable keyword for OpenAPI target, closes #​4075.

    Before

    import { OpenApiJsonSchema } from "@&#8203;effect/platform"
    import { Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "enum": [
            null
          ]
        }
      ]
    }
    */

    After

    import { OpenApiJsonSchema } from "@&#8203;effect/platform"
    import { Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
      "type": "string",
      "nullable": true
    }
    */
  • #​4128 8d978c5 Thanks @​gcanti! - JSONSchema: add type for homogeneous enum schemas, closes #​4127

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Literal("a", "b")
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "enum": [
        "a",
        "b"
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Literal("a", "b")
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "enum": [
        "a",
        "b"
      ]
    }
    */
  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: use { "type": "null" } to represent the null literal

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "enum": [
            null
          ]
        }
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.NullOr(Schema.String)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
    */
  • #​4138 cec0b4d Thanks @​gcanti! - JSONSchema: handle empty native enums.

    Before

    import { JSONSchema, Schema } from "effect"
    
    enum Empty {}
    
    const schema = Schema.Enums(Empty)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$comment": "/schemas/enums",
      "anyOf": [] // <= invalid schema!
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    enum Empty {}
    
    const schema = Schema.Enums(Empty)
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "/schemas/never",
      "not": {}
    }
    */

v3.11.6

Compare Source

Patch Changes
  • #​4118 662d1ce Thanks @​gcanti! - Allow the transformation created by the Class API to be annotated on all its components: the type side, the transformation itself, and the encoded side.

    Example

    import { Schema, SchemaAST } from "effect"
    
    class A extends Schema.Class<A>("A")(
      {
        a: Schema.NonEmptyString
      },
      [
        { identifier: "TypeID" }, // annotations for the type side
        { identifier: "TransformationID" }, // annotations for the the transformation itself
        { identifier: "EncodedID" } // annotations for the the encoded side
      ]
    ) {}
    
    console.log(SchemaAST.getIdentifierAnnotation(A.ast.to)) // Some("TypeID")
    console.log(SchemaAST.getIdentifierAnnotation(A.ast)) // Some("TransformationID")
    console.log(SchemaAST.getIdentifierAnnotation(A.ast.from)) // Some("EncodedID")
    
    A.make({ a: "" })
    /*
    ParseError: TypeID
    └─ ["a"]
       └─ NonEmptyString
          └─ Predicate refinement failure
             └─ Expected NonEmptyString, actual ""
    */
    
    Schema.encodeSync(A)({ a: "" })
    /*
    ParseError: TransformationID
    └─ Type side transformation failure
       └─ TypeID
          └─ ["a"]
             └─ NonEmptyString
                └─ Predicate refinement failure
                   └─ Expected NonEmptyString, actual ""
    */
  • #​4126 31c62d8 Thanks @​gcanti! - Rewrite the Arbitrary compiler from scratch, closes #​2312


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 14, 2024 04:11
hashdotai
hashdotai previously approved these changes Dec 14, 2024
@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/apps labels Dec 14, 2024
@hash-worker hash-worker bot added this pull request to the merge queue Dec 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Dec 14, 2024
@hash-worker hash-worker bot added this pull request to the merge queue Dec 14, 2024
Merged via the queue into main with commit da379b9 Dec 14, 2024
163 of 164 checks passed
@hash-worker hash-worker bot deleted the deps/js/effect-npm-packages branch December 14, 2024 05:40
Copy link
Contributor

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/block/v/1 $$16.7 \mathrm{ms} \pm 195 \mathrm{μs}\left({\color{lightgreen}-26.619 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$16.5 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{gray}1.04 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$16.0 \mathrm{ms} \pm 193 \mathrm{μs}\left({\color{gray}1.09 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$16.2 \mathrm{ms} \pm 158 \mathrm{μs}\left({\color{gray}-2.673 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$16.8 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}4.89 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$16.4 \mathrm{ms} \pm 179 \mathrm{μs}\left({\color{gray}-4.156 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$16.4 \mathrm{ms} \pm 178 \mathrm{μs}\left({\color{gray}-0.217 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$15.5 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{lightgreen}-32.025 \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 181 \mathrm{μs}\left({\color{lightgreen}-17.147 \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.9 \mathrm{ms} \pm 298 \mathrm{μs}\left({\color{gray}-2.552 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.4 \mathrm{ms} \pm 293 \mathrm{μs}\left({\color{gray}-0.661 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=2, PT=2, ET=2, E=2 $$57.7 \mathrm{ms} \pm 267 \mathrm{μs}\left({\color{gray}-3.217 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=0, E=2 $$43.8 \mathrm{ms} \pm 259 \mathrm{μs}\left({\color{gray}-1.698 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=0, ET=2, E=2 $$49.6 \mathrm{ms} \pm 308 \mathrm{μs}\left({\color{gray}-3.417 \mathrm{\%}}\right) $$ Flame Graph
entity_by_property depths: DT=0, PT=2, ET=2, E=2 $$54.0 \mathrm{ms} \pm 250 \mathrm{μs}\left({\color{gray}-2.443 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=255, PT=255, ET=255, E=255 $$103 \mathrm{ms} \pm 450 \mathrm{μs}\left({\color{gray}-0.004 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=0 $$39.1 \mathrm{ms} \pm 246 \mathrm{μs}\left({\color{lightgreen}-5.292 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=2, PT=2, ET=2, E=2 $$94.4 \mathrm{ms} \pm 447 \mathrm{μs}\left({\color{gray}0.461 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=0, E=2 $$77.2 \mathrm{ms} \pm 293 \mathrm{μs}\left({\color{gray}-3.086 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=0, ET=2, E=2 $$86.0 \mathrm{ms} \pm 331 \mathrm{μs}\left({\color{gray}-0.348 \mathrm{\%}}\right) $$ Flame Graph
link_by_source_by_property depths: DT=0, PT=2, ET=2, E=2 $$90.6 \mathrm{ms} \pm 508 \mathrm{μs}\left({\color{gray}0.192 \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 $$2.14 \mathrm{ms} \pm 13.0 \mathrm{μs}\left({\color{gray}0.324 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_one_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$5.34 \mathrm{s} \pm 536 \mathrm{ms}\left({\color{gray}-0.154 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$27.5 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}2.00 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$20.6 \mathrm{ms} \pm 61.1 \mathrm{μs}\left({\color{gray}-1.611 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$58.1 \mathrm{ms} \pm 296 \mathrm{μs}\left({\color{gray}1.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$180 \mathrm{ms} \pm 844 \mathrm{μs}\left({\color{gray}1.86 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$1.94 \mathrm{ms} \pm 5.84 \mathrm{μs}\left({\color{gray}-0.796 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$2.17 \mathrm{ms} \pm 8.40 \mathrm{μs}\left({\color{gray}0.182 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$1.98 \mathrm{ms} \pm 9.61 \mathrm{μs}\left({\color{gray}1.66 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$2.86 \mathrm{ms} \pm 11.1 \mathrm{μs}\left({\color{lightgreen}-5.601 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.28 \mathrm{ms} \pm 98.8 \mathrm{μs}\left({\color{gray}-0.335 \mathrm{\%}}\right) $$ Flame Graph

scaling_read_entity_complete_zero_depth

Function Value Mean Flame graphs
entity_by_id 50 entities $$4.20 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}2.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 5 entities $$1.97 \mathrm{ms} \pm 8.82 \mathrm{μs}\left({\color{gray}0.288 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1 entities $$1.95 \mathrm{ms} \pm 8.46 \mathrm{μs}\left({\color{gray}-0.553 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$2.08 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}-2.237 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 25 entities $$3.33 \mathrm{ms} \pm 13.6 \mathrm{μs}\left({\color{gray}0.371 \mathrm{\%}}\right) $$ Flame Graph

CiaranMn pushed a commit that referenced this pull request Jan 13, 2025
Co-authored-by: hash-worker[bot] <180894564+hash-worker[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps 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