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

Require cycle warning #358

Closed
hardcodet opened this issue Jun 14, 2020 · 8 comments
Closed

Require cycle warning #358

hardcodet opened this issue Jun 14, 2020 · 8 comments
Labels
status: done/released Issue has been completed, no further action is needed. type: fix Issues describing a broken feature.

Comments

@hardcodet
Copy link

Probably minor, but a still a bit of a red flag: I'm getting the build warning about cyclic dependencies - maybe this can be optimized?

Require cycle: node_modules\class-transformer\TransformOperationExecutor.js -> node
_modules\class-transformer\storage.js -> node_modules\class-transformer\metadata\MetadataStorage.js -> node_modules\class-tr
ansformer\TransformOperationExecutor.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
@allan-simon
Copy link

I'm having it to, @jotamorais is it something that can easily be fixed ?

@caiobiodere
Copy link

Having same issue here any plans to fix this? Otherwise I will have to fork this project and fix it

@caiobiodere
Copy link

@jotamorais any plans on fixing this issue?

@jotamorais
Copy link
Member

We are reviewing a few PRs that we need to merge and also preparing a release with a those PRs and then we will start tackling these issues.
If you have gone through the issue and have an idea on how to fix it, please, consider forking and submitting a PR and will gladly review and merge.

I appreciate your understanding and will keep you posted once the release is out.

@allan-simon
Copy link

I will try to propose a PR

allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
@allan-simon
Copy link

allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
allan-simon added a commit to allan-simon/class-transformer that referenced this issue Jul 29, 2020
…parate file

because:
    * TransformationType enum is used by both TransformOperationExecutor  and MetadataStorage
    * TransformationType was in the same file as TransformOperationExecutor
    * TransformOperationExecutor require MetadataStorage
so: importing TransformationType from TransformOperationExecutor.ts was as a side effect importing MetadataStorage.ts that was importing TransformationType etc. creating a cycle
@NoNameProvided
Copy link
Member

Fixed in #380.

@NoNameProvided NoNameProvided added status: done/released Issue has been completed, no further action is needed. type: fix Issues describing a broken feature. labels Jul 29, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: done/released Issue has been completed, no further action is needed. type: fix Issues describing a broken feature.
5 participants