Skip to content

Conversation

Paulijuz
Copy link
Member

@Paulijuz Paulijuz commented Oct 11, 2025

This PR replaces #443.

This PR simplifies the interface for service methods.

Before:

someService.client(prisma).execute({
  params: { ... },
  data: { ... },
  session: null,
}

After:

someService({
  params: { ... },
  data: { ... },
}

This PR also moves all the actions from their own folder src/actions to a dedicated actions.ts file per service in src/services.

Finally, this PR replaces namespaces with objects as that is what the docs officialy recommend. Excert:

It is also worth noting that, for Node.js applications, modules are the default and we recommended modules over namespaces in modern code.

Starting with ECMAScript 2015, modules are native part of the language, and should be supported by all compliant engine implementations. Thus, for new projects modules would be the recommended code organization mechanism.

There were som problems with self referential service before, but 90% of that has been fixed by removing an unecessary generic from the auhter.

Copy link
Member

@JohanHjelsethStorstad JohanHjelsethStorstad left a comment

Choose a reason for hiding this comment

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

Seems to work now

@JohanHjelsethStorstad JohanHjelsethStorstad merged commit 81f4c45 into main Oct 11, 2025
3 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