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

feat(types): add middlewares types #1161

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

thib3113
Copy link
Contributor

@thib3113 thib3113 commented Dec 3, 2022

Add typing for the optionals middlewares

PS : I typed the encryption middleware too, but I think it's not a good middleware, not secure (IV not changing), and hard to use (password length need to be a strict length)

💎 Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

Copy link
Member

@shawnmcknight shawnmcknight left a comment

Choose a reason for hiding this comment

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

A couple things here:

  1. What's the use case for making this change?
  2. Although there are many places in the existing types where namespace is used, its a pattern I'd prefer to avoid in the future. Can the changes you're making be accomplished without using them?
  3. Types should always be PascalCase and not camelCase. There are several changes here using camelCase.

@thib3113
Copy link
Contributor Author

@shawnmcknight

  1. What's the use case for making this change?

It allow to add middleware in moleculer.config.ts, without using ts-ignore
image

  1. Although there are many places in the existing types where namespace is used, its a pattern I'd prefer to avoid in the future. Can the changes you're making be accomplished without using them?

I will check

  1. Types should always be PascalCase and not camelCase. There are several changes here using camelCase.

Ok, I will check

 - remove namespaces
 - rename types as PascalCase
@thib3113
Copy link
Contributor Author

when I want to use the middleware in my moleculer.config.ts now :
image

@thib3113 thib3113 marked this pull request as draft December 11, 2022 15:08
 - fix TU
@thib3113 thib3113 marked this pull request as ready for review December 11, 2022 15:46
@thib3113
Copy link
Contributor Author

@shawnmcknight any news on this ?

index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
Copy link
Member

@shawnmcknight shawnmcknight left a comment

Choose a reason for hiding this comment

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

Overall this looks good. I had a few requests for adjustment.

@thib3113
Copy link
Contributor Author

Please @shawnmcknight / @icebob can you review this PR ? it is waiting for nearly a year, where PR #1246 with same changes was validated in 2 days (litterally the PR just re-do a part of this one) ...

@shawnmcknight shawnmcknight removed their request for review May 16, 2024 20:07
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.

2 participants