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

chore: lodash tree shaking imports #38

Merged
merged 8 commits into from
Sep 28, 2023

Conversation

rtpa25
Copy link
Contributor

@rtpa25 rtpa25 commented Sep 23, 2023

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2023

⚠️ No Changeset found

Latest commit: 1838b00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wrn14897
Copy link
Contributor

wrn14897 commented Sep 23, 2023

We are going to add this to the guide soon for the better readability (ideally enforce by linting). Can you apply the following pattern on modules import ? Basically imports are separated into 3 chunks by a new line:

  1. built-in
  2. 3rd-party
  3. internal

And each chunk of imports are sorted alphabetically.

@@ -1,6 +1,6 @@
import * as fns from 'date-fns';
import SqlString from 'sqlstring';
import _ from 'lodash';
import map from 'lodash/map';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need to do the tree shaking for files in api/.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will assume, bundle size is not a concern for server side, as you are not deploying onto a serverless environment. Please correct me if am wrong

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct, its not for the serverless environment

@rtpa25
Copy link
Contributor Author

rtpa25 commented Sep 24, 2023

Taken care of the import order issues

@wrn14897
Copy link
Contributor

Things look good. Just need to resolve the conflicts and rollback changes in /api :)

Copy link
Contributor

@wrn14897 wrn14897 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for cleaning things up!

@kodiakhq kodiakhq bot merged commit 8a53b3e into hyperdxio:main Sep 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable tree shaking for lodash on the frontend
2 participants