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

Solving circular import hack #444

Merged
merged 1 commit into from
Feb 3, 2021
Merged

Conversation

olemartinorg
Copy link

These fixes should prevent problems with circular imports. I still get 14 warnings about circular imports in rollup (regardless of using the main commonjs plugin or the alternate one), but at least the emitted code seems to work fine in both now.

This fixes #443 and hopefully #430, although I haven't been able to reproduce the issue in webpack.

I also looked into extracting other circular usages (like totext.ts accessing RRule.FREQUENCIES), but that quickly produced quite a lot of changes. I can continue trying to weed out the rest of the circular import warnings if you want, just let me know.


Thanks for contributing to rrule!

To submit a pull request, please verify that you have done the following:

  • [Y] Merged in or rebased on the latest master commit
  • [Y] Linked to an existing bug or issue describing the bug or feature you're
    addressing
  • [N] Written one or more tests showing that your change works as advertised

This prevents problems with circular imports. I still get 14 warnings about circular imports in rollup (regardless of using the main commonjs plugin or the alternate one), but at least the emitted code seems to work fine in both now.
@tgrosinger
Copy link

I can confirm that it solves #443 for me.

@kibertoad
Copy link
Contributor

@jakubroztocil Ping?..

tgrosinger added a commit to tgrosinger/slated-obsidian that referenced this pull request Jan 29, 2021
A required fix is added in jkbrzt/rrule#444
Until that PR is merged, we will use the source commit directly.
@tgrosinger
Copy link

Any chance we can get this merged? It's difficult using an unpublished fork in my project.

@jakubroztocil or @olemartinorg?

@olemartinorg
Copy link
Author

I would if I could. As for me, I don't really care that much anymore. I have stopped using the dependency that had this as a dependency in my project - so don't count on me for solving the other circular import problems.

tgrosinger added a commit to tgrosinger/slated-obsidian that referenced this pull request Jan 30, 2021
A required fix is added in jkbrzt/rrule#444
Until that PR is merged, we will use a forked package publication.
tgrosinger added a commit to tgrosinger/slated-obsidian that referenced this pull request Jan 30, 2021
A required fix is added in jkbrzt/rrule#444
Until that PR is merged, we will use a forked package publication.
@kibertoad
Copy link
Contributor

I would be more than happy to help address remaining circular dependencies, as well as help maintaining project in general (we plan to start depending on it from node-schedule), but looks like current maintainers are MIA :(

@tgrosinger
Copy link

In the interim I published a package with this change so I can use it in my project easier

@tgrosinger
Copy link

I would if I could. As for me, I don't really care that much anymore. I have stopped using the dependency that had this as a dependency in my project - so don't count on me for solving the other circular import problems.

That's totally fair. Thanks again @olemartinorg for the work you did to get it to this point. It's been hugely helpful.

@doylio
Copy link

doylio commented Feb 3, 2021

I've been trying to solve this all day! I hope this gets merged soon! Thanks @olemartinorg !

getnlp._nlp = require('./nlp')
}
return getnlp._nlp
} as GetNlp
Copy link
Collaborator

Choose a reason for hiding this comment

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

The rationale for this IIRC was to make nlp an optional dependency - I had in mind to eventually split it out into its own package. But this simplifies things for now, so we should merge it.

ToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common)
ToText.IMPLEMENTED[Frequency.WEEKLY] = common
ToText.IMPLEMENTED[Frequency.MONTHLY] = common
ToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@davidgoli davidgoli merged commit 3058211 into jkbrzt:master Feb 3, 2021
@tgrosinger
Copy link

Hooray, thank you!

@doylio
Copy link

doylio commented Feb 3, 2021

Amazing!!!

@tgrosinger
Copy link

@davidgoli would you also be able to publish a new release to NPM? I don't think I can use the changes in my project until a release has been made.

@davidgoli
Copy link
Collaborator

Published 2.6.8

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.

Cannot find module nlp
5 participants