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

Is componentsScan deprecated or not? #2087

Closed
borjapazr opened this issue Sep 14, 2022 · 4 comments
Closed

Is componentsScan deprecated or not? #2087

borjapazr opened this issue Sep 14, 2022 · 4 comments
Assignees

Comments

@borjapazr
Copy link
Contributor

As I see in the documentation componentsScan seems to be deprecated. However, reviewing other parts of the documentation it appears exposed as a functionality that can be used, even in the examples on GitHub there are references to this functionality. Is componentsScan deprecated or not? In case its use is not recommended, what alternatives are there if we have a set of components that are not imported explicitly in another components and we want them to be detected by the TSED dependency container?

@Romakita
Copy link
Collaborator

Romakita commented Sep 14, 2022

Hello @borjapazr

Here is the complete answers :)
https://v7.tsed.io/getting-started/migration-from-v6.html#components-scan

Ts.ED don't need Components Scan to works. Components Scan is just a feature that simplify the development process.
It can be replaced by barrelsby (tooling) or manual ES6 import.

Using ES6 import:

import {MyService} from "./MyService"; // if the symbole is used
import "./MyService"; // if the symbole isn't used but you have use it because you use hooks

See you
Romain

@borjapazr
Copy link
Contributor Author

Great! Very good answer @Romakita 😊

So from v7 componentsScan will no longer be available inside @Configuration and mount can no longer be used with globs, right?

I think it's perfect to use barrelsby. I'm already using barrel files, so the upgrade won't be too dramatic.

Thank you! 🙏

@Romakita
Copy link
Collaborator

Mount option will only accept Symbols and not a globpattern. componentsScan will be removed ;)

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants