Skip to content

refactor(effect-app): remove helpers Effect already provides - #914

Merged
omegent-app[bot] merged 7 commits into
mainfrom
t3-discord/759010c1
Oct 8, 2026
Merged

omegent-app[bot] merged 7 commits into
mainfrom
t3-discord/759010c1

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove effect-app helpers that Effect 4 already provides, including whole modules effect-app/_ext/date and effect-app/_ext/misc, and drop the date-fns dependency.
  • Point in-repo call sites at the Effect APIs.
  • Add migrateEffectAppSource in effect-app/migration/nativeEffect so an app can rewrite one file at a time.

Migration

import { migrateEffectAppSource } from "effect-app/migration/nativeEffect"

const next = migrateEffectAppSource(source)

The table nativeEffectReplacements lists each old name, the Effect expression, and the imports to add.

Three replacements are not identical on every input:

  • Chunk.containsWith calls the equivalence as (needle, element). The old elem called it as (element, needle). A symmetric equivalence is unchanged.
  • DateAdd* and DateSub* become pipeZonedLocal(date, DateTime.add({ days })) from effect-app/DateTime. That attaches the process timezone and returns the instant with toDateUtc, so the local calendar stays. makeZonedLocal is the same zoning without the pipe.
  • Record.values expects one value type. A mapped type whose value depends on its key should use Object.values.

dropUndefined and fromBool stay. So do groupByT (any key, entry list), randomElement, findFirstMap, schema constructors that add construction defaults, and dropUndefinedT / dropUndefinedT2 / dropUndefinedRec.

The changeset is a patch for the fixed group, so the next release is 4.0.1.

Test plan

  • vitest packages/effect-app/test/nativeEffectMigration.test.ts and dateTimeLocal.test.ts
  • tsgo on effect-app, infra, vue, and e2e
  • Agent ship gate on push (pnpm check, pnpm lint, pnpm test)

opened by patroza in chat thread Discord · Discord · T3


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Drop aliases and wrappers that match Effect 4, including the date-fns calendar module, and add migrateEffectAppSource to rewrite call sites.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app
omegent-app Bot marked this pull request as ready for review October 8, 2026 06:15
@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/@effect-app/cli@914

effect-app

npm i https://pkg.pr.new/effect-app@914

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/@effect-app/eslint-codegen-model@914

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/@effect-app/eslint-shared-config@914

@effect-app/infra

npm i https://pkg.pr.new/@effect-app/infra@914

@effect-app/vue

npm i https://pkg.pr.new/@effect-app/vue@914

@effect-app/vue-components

npm i https://pkg.pr.new/@effect-app/vue-components@914

commit: 056e287

omegent-app Bot and others added 6 commits October 8, 2026 06:33
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
These helpers are not the same call as Record.filter and Option.liftPredicate. typedValuesOf still becomes Record.values, with Object.values where the value type depends on the key.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
DateAdd* and DateSub* rewrite through DateTime.fromDateUnsafe(date).pipe(DateTime.add({ unit }), DateTime.toDate).

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Add makeZonedLocal and pipeZonedLocal. DateAdd* and DateSub* migrate through pipeZonedLocal, which keeps the local calendar and returns the instant with toDateUtc.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app
omegent-app Bot merged commit 222e619 into main Oct 8, 2026
5 checks passed
@omegent-app
omegent-app Bot deleted the t3-discord/759010c1 branch October 8, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants