Skip to content

chore: Clean up src/utilities exports#9783

Merged
bnussman-akamai merged 6 commits intolinode:developfrom
bnussman-akamai:chore/repo-clean-up-october
Oct 18, 2023
Merged

chore: Clean up src/utilities exports#9783
bnussman-akamai merged 6 commits intolinode:developfrom
bnussman-akamai:chore/repo-clean-up-october

Conversation

@bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Oct 11, 2023

Description 📝

  • Removes default exports in favor of named exports ✏️
  • Removes some unused helper functions 🗑️
  • No logic changes or refactors, only find and replace of imports and exports 🚫

How to test 🧪

Verification steps

  • Verify all Github Actions checks pass ✅
  • Verify e2es pass 🤞🏼
  • Open Cloud Manager and perform an overall check of the application for defects 👁️

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@bnussman-akamai bnussman-akamai marked this pull request as ready for review October 11, 2023 17:43
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 11, 2023 17:43
@bnussman-akamai bnussman-akamai requested review from jaalah-akamai and jdamore-linode and removed request for a team October 11, 2023 17:43
});
};

export const isOSMac = navigator.userAgent.includes('Mac');
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved this to src/utilities/userAgent.ts

@@ -1,4 +1,7 @@
export default (input: string[], separator: string = ','): string => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the case against default exports and why named exports provide better DX. We are exporting an unnamed function which makes our intelliesense unable to auto import it

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved some utilities out of their own folder in cases where the folder is unnecessary

In my opinion, this is bad 👎🏼

packages/manager/src/utilities/isPropValid
├── index.ts
└── isPropValid.ts

and this is good 👍🏼

packages/manager/src/utilities/pricing
├── backups.test.tsx
├── backups.ts
├── constants.ts
├── dynamicPricing.test.ts
├── dynamicPricing.ts
├── dynamicVolumePrice.test.ts
├── dynamicVolumePrice.ts
├── kubernetes.test.tsx
├── kubernetes.ts
├── linodes.test.ts
└── linodes.ts

Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Thanks @bnussman-akamai! Confirmed that the E2E tests look good (you can disregard the CI failures; DBaaS failures should be fixed in develop, and the config failure should be fixed by #9798). Spent some time messing around in Cloud Manager and didn't notice any UI differences or other changes in behavior.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants