Skip to content

Conversation

@KhraksMamtsov
Copy link
Contributor

I’d like to suggest changing the name for this family of functions.

Effect.ensureSuccessType 
->
Effect.satisfiesSuccess

It seems to be a clear and well-established term (satisfies) in TypeScript, and it would be better to use it.

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Related

  • Related Issue #
  • Closes #

@gcanti
Copy link
Contributor

gcanti commented Oct 13, 2025

+1 for changing ensure to satisfies

I would keep the Type postfix though

@IMax153
Copy link
Member

IMax153 commented Oct 18, 2025

Agree with ensure -> satisfies and keeping the Type postfix.

@KhraksMamtsov if you wouldn't mind making that change, we can get this merged.

@KhraksMamtsov
Copy link
Contributor Author

@IMax153 done

@KhraksMamtsov
Copy link
Contributor Author

BTW, I think Schedule.ensure* could be aligned as well

@IMax153
Copy link
Member

IMax153 commented Oct 18, 2025

@KhraksMamtsov - perhaps we could also address #408 and add the satisfies combinators to Layer as part of this PR?

@KhraksMamtsov
Copy link
Contributor Author

KhraksMamtsov commented Oct 18, 2025

@IMax153 Of course, with pleasure!
I also wanted to clarify — would it be possible to name the parameter responsible for context uniformly across all modules?
Right now, in Effect it’s called Requirements,
in Schedule it’s Services,
and in Layer it will also be Services.
What do you think?

@IMax153
Copy link
Member

IMax153 commented Oct 18, 2025

I'm not sure about the parameter renaming, as we tend to use R everywhere for effect. But we are leaning into the services terminology for 4.0.

Let's defer that to a separate potential PR but I'll still ping @mikearnaldi to give his 2 cents here.

@KhraksMamtsov
Copy link
Contributor Author

@IMax153 I added type constraints for Layer

PS. I also noticed that Effect uses satisfiesError, and Layer uses satisfiesFailure.

@IMax153
Copy link
Member

IMax153 commented Oct 19, 2025

We can standardize this to satisfiesErrorType I think

@IMax153
Copy link
Member

IMax153 commented Oct 19, 2025

@KhraksMamtsov looking through the changes, let's make one last adjustment and standardize around satisfiesRequirementsType for now.

We can change the naming layer if we decide services is better. But since Context doesn't exist in 4.0 I think using requirements for now makes the most sense.

Then we can get this merged.

@KhraksMamtsov
Copy link
Contributor Author

@IMax153 done
Do we need to do the same with Schedule.satisfiesServicesType?

@IMax153
Copy link
Member

IMax153 commented Oct 19, 2025

Do we need to do the same with Schedule.satisfiesServicesType?

@KhraksMamtsov - you know what, I'm so sorry, but can we standardize around what you originally suggested? ensureServicesType for everything?

I'm realizing we've modified the names of other combinators that accessed context to services, so that's probably the most consistent.

I'm really sorry for the back and forth. Thanks for your help on this.

@KhraksMamtsov
Copy link
Contributor Author

@IMax153 no problem — that’s part of the workflow :)
so just to clarify,
we want to use satisfiesServicesType (satisfies — I think that’s what you meant) for all three modules — Effect, Schedule, and Layer, right?

@IMax153
Copy link
Member

IMax153 commented Oct 19, 2025

we want to use satisfiesServicesType (satisfies — I think that’s what you meant) for all three modules

Sigh - it is, my apologies. That's what I get for responding when I'm over tired 😅

@KhraksMamtsov
Copy link
Contributor Author

It seems to be ready

Copy link
Member

@IMax153 IMax153 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a few docgen issues need resolution from CI.

Copy link
Member

@IMax153 IMax153 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed one - I'll just apply this.

@github-actions
Copy link

Bundle Size Analysis

File Name Current Size Previous Size Difference
bundle/basic.ts 6.06 KB 6.06 KB 0.00 KB (0.00%)
bundle/batching.ts 8.30 KB 8.30 KB 0.00 KB (0.00%)
bundle/brand.ts 6.37 KB 6.37 KB 0.00 KB (0.00%)
bundle/cache.ts 9.42 KB 9.42 KB 0.00 KB (0.00%)
bundle/config.ts 15.94 KB 15.94 KB 0.00 KB (0.00%)
bundle/differ.ts 13.74 KB 13.74 KB 0.00 KB (0.00%)
bundle/http-client.ts 18.39 KB 18.39 KB 0.00 KB (0.00%)
bundle/logger.ts 8.56 KB 8.56 KB 0.00 KB (0.00%)
bundle/metric.ts 8.59 KB 8.59 KB 0.00 KB (0.00%)
bundle/optic.ts 7.55 KB 7.55 KB 0.00 KB (0.00%)
bundle/pubsub.ts 12.93 KB 12.93 KB 0.00 KB (0.00%)
bundle/queue.ts 10.83 KB 10.83 KB 0.00 KB (0.00%)
bundle/schedule.ts 9.27 KB 9.27 KB 0.00 KB (0.00%)
bundle/schema-arbitrary.ts 15.74 KB 15.74 KB 0.00 KB (0.00%)
bundle/schema-equivalence.ts 14.82 KB 14.82 KB 0.00 KB (0.00%)
bundle/schema-format.ts 14.92 KB 14.92 KB 0.00 KB (0.00%)
bundle/schema-json-schema.ts 16.24 KB 16.24 KB 0.00 KB (0.00%)
bundle/schema-record-literals-key.ts 13.16 KB 13.16 KB 0.00 KB (0.00%)
bundle/schema-string-async.ts 11.20 KB 11.20 KB 0.00 KB (0.00%)
bundle/schema-string-check.ts 9.99 KB 9.99 KB 0.00 KB (0.00%)
bundle/schema-string.ts 9.54 KB 9.54 KB 0.00 KB (0.00%)
bundle/schema-stringPojo.ts 14.73 KB 14.73 KB 0.00 KB (0.00%)
bundle/schema-template-literal.ts 12.04 KB 12.04 KB 0.00 KB (0.00%)
bundle/schema.ts 14.35 KB 14.35 KB 0.00 KB (0.00%)
bundle/stm.ts 11.66 KB 11.66 KB 0.00 KB (0.00%)
bundle/stream.ts 8.24 KB 8.24 KB 0.00 KB (0.00%)

@github-actions
Copy link

📊 JSDoc Documentation Analysis

📈 Current Analysis Results
Analyzing 63 TypeScript files in packages/effect/src/ (including schema and config subdirectories)...

============================================================
         EFFECT JSDOC ANALYSIS REPORT
============================================================

📊 SUMMARY STATISTICS
------------------------------
Total files analyzed: 63
Total exported members: 2119
Missing @example: 999 (47.1%)
Missing @category: 338 (16.0%)

🎯 TOP FILES NEEDING ATTENTION
----------------------------------------
1. schema/Schema.ts
   📝 405 missing examples, 🏷️  229 missing categories
   📦 405 total exports
2. schema/AST.ts
   📝 73 missing examples, 🏷️  13 missing categories
   📦 73 total exports
3. schema/Annotations.ts
   📝 38 missing examples, 🏷️  32 missing categories
   📦 38 total exports
4. schema/Getter.ts
   📝 47 missing examples, 🏷️  4 missing categories
   📦 47 total exports
5. PubSub.ts
   📝 25 missing examples, 🏷️  16 missing categories
   📦 37 total exports
6. schema/Transformation.ts
   📝 25 missing examples, 🏷️  14 missing categories
   📦 25 total exports
7. Config.ts
   📝 33 missing examples, 🏷️  5 missing categories
   📦 33 total exports
8. Cause.ts
   📝 28 missing examples, 🏷️  2 missing categories
   📦 69 total exports
9. Effect.ts
   📝 24 missing examples, 🏷️  1 missing categories
   📦 227 total exports
10. SynchronizedRef.ts
   📝 24 missing examples, 🏷️  0 missing categories
   📦 24 total exports
11. schema/Issue.ts
   📝 22 missing examples, 🏷️  2 missing categories
   📦 22 total exports
12. schema/ToParser.ts
   📝 24 missing examples, 🏷️  0 missing categories
   📦 24 total exports
13. ConfigProvider.ts
   📝 21 missing examples, 🏷️  1 missing categories
   📦 21 total exports
14. DateTime.ts
   📝 20 missing examples, 🏷️  0 missing categories
   📦 108 total exports
15. Optic.ts
   📝 18 missing examples, 🏷️  0 missing categories
   📦 18 total exports

✅ PERFECTLY DOCUMENTED FILES
-----------------------------------
   Clock.ts (5 exports)
   Console.ts (21 exports)
   FiberHandle.ts (15 exports)
   FiberMap.ts (19 exports)
   FiberSet.ts (14 exports)
   Match.ts (57 exports)
   MutableRef.ts (17 exports)
   RcRef.ts (5 exports)
   RegExp.ts (3 exports)
   Runtime.ts (3 exports)
   Schedule.ts (49 exports)
   Symbol.ts (1 exports)
   index.ts (0 exports)
   schema/index.ts (0 exports)

🔍 SAMPLE MISSING ITEMS FROM schema/Schema.ts
-----------------------------------
   Optionality (type, line 53): missing example, category
   Mutability (type, line 60): missing example, category
   ConstructorDefault (type, line 67): missing example, category
   MakeOptions (interface, line 75): missing example, category
   Bottom (interface, line 99): missing example, category
   declareConstructor (interface, line 179): missing example, category
   declareConstructor (function, line 203): missing example
   declare (interface, line 227): missing example
   declare (function, line 236): missing example, category
   revealBottom (function, line 256): missing example, category

📋 BREAKDOWN BY EXPORT TYPE
-----------------------------------
type: 123 missing examples, 67 missing categories
const: 377 missing examples, 96 missing categories
interface: 177 missing examples, 106 missing categories
class: 54 missing examples, 3 missing categories
function: 241 missing examples, 51 missing categories
namespace: 27 missing examples, 15 missing categories

📈 DOCUMENTATION PROGRESS
------------------------------
Examples: 1120/2119 (52.9% complete)
Categories: 1781/2119 (84.0% complete)

============================================================
Analysis complete! 1337 items need attention.
============================================================

📄 Detailed results saved to: jsdoc-analysis-results.json

This comment is automatically updated on each push. View the analysis script for details.

@IMax153 IMax153 merged commit a7134ba into Effect-TS:main Oct 19, 2025
13 checks passed
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.

3 participants