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

Micro: renaming to align with Effect module #3096

Merged
merged 24 commits into from
Jun 30, 2024
Merged

Micro: renaming to align with Effect module #3096

merged 24 commits into from
Jun 30, 2024

Conversation

gcanti
Copy link
Contributor

@gcanti gcanti commented Jun 26, 2024

Micro: align with Effect module (renamings and new combinators).

General naming convention rule: <reference module (start with lowercase)><api (start with Uppercase)>.

  • Failure -> MicroCause
    • Failure.Expected<E> -> MicroCause.Fail<E>
    • Failure.Unexpected -> MicroCause.Die
    • Failure.Aborted -> MicroCause.Interrupt
    • FailureExpected -> causeFail
    • FailureUnexpected -> causeDie
    • FailureAborted -> causeInterrupt
    • failureIsExpected -> causeIsFail
    • failureIsExpected -> causeIsFail
    • failureIsUnexpected -> causeIsDie
    • failureIsAborted -> causeIsInterrupt
    • failureSquash -> causeSquash
    • failureWithTrace -> causeWithTrace
  • Result -> MicroExit
    • ResultAborted -> exitInterrupt
    • ResultSuccess -> exitSucceed
    • ResultFail -> exitFail
    • ResultFailUnexpected -> exitDie
    • ResultFailWith -> exitFailCause
    • resultIsSuccess -> exitIsSuccess
    • resultIsFailure -> exitIsFailure
    • resultIsAborted -> exitIsInterrupt
    • resultIsFailureExpected -> exitIsFail
    • resultIsFailureUnexpected -> exitIsDie
    • resultVoid -> exitVoid
  • DelayFn -> MicroSchedule
    • delayExponential -> scheduleExponential
    • delaySpaced -> scheduleSpaced
    • delayWithMax -> scheduleWithMaxDelay
    • delayWithMaxElapsed -> scheduleWithMaxElapsed
    • delayWithRecurs -> scheduleRecurs and make it a constructor
    • add addDelay combinator
  • Handle
    • abort -> interrupt
    • unsafeAbort -> unsafeInterrupt
  • provideServiceMicro -> provideServiceEffect
  • fromResult -> fromExit
  • fromResultSync -> fromExitSync
  • failWith -> failCause
  • failWithSync -> failCauseSync
  • asResult -> exit
  • filterOrFailWith -> filterOrFailCause
  • repeatResult -> repeatExit
  • catchFailure -> catchAllCause
  • catchFailureIf -> catchCauseIf
  • catchExpected -> catchAll
  • catchUnexpected -> catchAllDefect
  • tapFailure -> tapErrorCause
  • tapFailureIf -> tapErrorCauseIf
  • tapExpected -> tapError
  • tapUnexpected -> tapDefect
  • mapFailure -> mapErrorCause
  • matchFailureMicro -> matchCauseEffect
  • matchFailure -> matchCause
  • matchMicro -> matchEffect
  • onResult -> onExit
  • onResultIf -> onExitIf
  • onFailure -> onError
  • onAbort -> onInterrupt
  • abort -> interrupt
  • runPromiseResult -> runPromiseExit
  • runSyncResult -> runSyncExit
  • rename delay option to schedule

@gcanti gcanti added the micro label Jun 26, 2024
Copy link

changeset-bot bot commented Jun 26, 2024

🦋 Changeset detected

Latest commit: dac8cc9

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

This PR includes changesets to release 29 packages
Name Type
effect Patch
@effect/cli Patch
@effect/cluster-browser Patch
@effect/cluster-node Patch
@effect/cluster-workflow Patch
@effect/cluster Patch
@effect/experimental Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/platform Patch
@effect/printer-ansi Patch
@effect/printer Patch
@effect/rpc-http Patch
@effect/rpc Patch
@effect/schema Patch
@effect/sql-drizzle 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-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/sql Patch
@effect/typeclass Patch
@effect/vitest 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

@datner
Copy link
Contributor

datner commented Jun 28, 2024

Wouldn't we mark these as major changes?

@gcanti
Copy link
Contributor Author

gcanti commented Jun 28, 2024

@datner because the Micro module is tagged as @experimental

@gcanti gcanti marked this pull request as ready for review June 30, 2024 16:08
@gcanti gcanti requested a review from mikearnaldi as a code owner June 30, 2024 16:08
@gcanti gcanti requested a review from tim-smart June 30, 2024 16:08
@tim-smart tim-smart merged commit 5c0ceb0 into main Jun 30, 2024
12 checks passed
@tim-smart tim-smart deleted the micro-renaming branch June 30, 2024 23:59
@github-actions github-actions bot mentioned this pull request Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants