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

fix(core): Replace all moment imports with moment-timezone #8337

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented Jan 15, 2024

A lot of nodes code imports moment and then uses moment.tz, which only works if somewhere else in the code we have already loaded moment-timezone.
But sometimes moment.tz gets called before moment-timezone has been imported.
As we decouple and lazy-load more code, stuff like this is a lot more likely to happen.

That's why I've removed moment as a direct dependency, and hopefully import/no-extraneous-dependencies would prevent people from adding it back.

Review / Merge checklist

  • PR title and summary are descriptive

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Jan 15, 2024
@rorpage
Copy link

rorpage commented Jan 15, 2024

Closes #8336

Copy link

cypress bot commented Jan 15, 2024

1 flaky test on run #3763 ↗︎

0 331 5 0 Flakiness 1

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project: n8n Commit: aacd931e65
Status: Passed Duration: 03:20 💡
Started: Jan 15, 2024 2:33 PM Ended: Jan 15, 2024 2:36 PM
Flakiness  cypress/e2e/17-sharing.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Sharing > should work for admin role on credentials created by others (also can share it with themselves) Test Replay Screenshots Video

Review all test suite changes for PR #8337 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit 52a2e25 into master Jan 15, 2024
28 checks passed
@netroy netroy deleted the fix-moment-tz-import branch January 15, 2024 14:45
@github-actions github-actions bot mentioned this pull request Jan 16, 2024
@janober
Copy link
Member

janober commented Jan 16, 2024

Got released with n8n@1.24.1

@rorpage
Copy link

rorpage commented Jan 16, 2024

This is so great. Thank you all so much!!

@github-actions github-actions bot mentioned this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants