Effect-TS / examples

A repository of examples showing how to use Effect
82 stars 10 forks source link

Update starter and starter-vite-tsc examples #4

Closed alenkis closed 1 year ago

alenkis commented 1 year ago

Updates starter-vite-tsc as mentioned in https://github.com/Effect-TS/examples/issues/2

I can update the other one's if these changes make sense

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 9673e9fc52b04ffb9526e52066d9eb390e36c62e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

gcanti commented 1 year ago

Thank you @alenkis, we have recently released effect v2.0.0-next.16 (Announcement: link). Since this example (along with starter) is linked from the docs, it's now important that all imports are from the effect package rather than individual modules.

alenkis commented 1 year ago

thanks @gcanti!

I've updated starter-vite-tsc and starter to the newest release, removed all the individual effect modules and updated other deps too. I've also realized that the ~/lib pattern no longer makes sense so I've removed it. It's much more convenient to just directly import from effect now with the newest release 👍

gcanti commented 1 year ago

I've also realized that the ~/lib pattern no longer makes sense so I've removed it

:+1:

p.s.

Using pipe (the function) is fine, just FYI there's also a .pipe() method on all data types now:

program.pipe(
  Effect.provideLayer(NameServiceLive),
  Effect.tapErrorCause(Effect.logCause({ level: "Error" })),
  Effect.runFork
);