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

Breakup Utils Package (Breaking change) #8987

Closed
wants to merge 15 commits into from

Conversation

aaronmgdr
Copy link
Member

Description

This PR separates our the Utils package into files that depend on google-libphonenumber and country-data. and those that do not. Our goal here is to reduce the package size of @celo/utils as many will want to use the utils but wont need any phone number capability.

Other changes

  • removed lodash from @celo/utils. as far as i could tell it was not used
  • added "exclude": ["**/*.test.ts"] to tsconfig for the @celo/utils and phone-utils packages because before the lib folder had all our tests in it which was then published to NPM. which i think would increase the package size.

Tested

Ran the original tests apart from some import changes all is good

Related issues

Backwards compatibility

No. anyone who was importing {PhoneNumberUtils, getCountryEmoji, getPhoneHash, LocalizedCountry, Countries, validatePhone, validateInput } from "@celo/utils" must now import from @celo/phone-utils

Furthermore the io.ts file was split up and E164PhoneNumberType, AttestationServiceStatusResponseType, AttestationServiceTestRequestType, AttestationRequestType, GetAttestationRequestType, AttestationRequest, AttestationResponseType, AttestationResponse must be imported from @celo/phone-utils too.

This is because all those types indirectly depend on E164PhoneNumberType which uses isE164NumberStrict. One alternative is to change this to use isE164Number from celo/base which is regeex based instead but im not sure of the affects of that. but it would greatly simplify a lot here.

Documentation

generated some doc files. not sure if something else is needed

Everything from celo/utils which used google-libphonenumber or country.js has been move here include the io.ts file.
@aaronmgdr aaronmgdr changed the title Aaronmgder/utils breakup Breakup Utils Package (Breaking change) Nov 18, 2021
@aaronmgdr aaronmgdr mentioned this pull request Nov 19, 2021
dckesler and others added 5 commits December 15, 2021 13:08
# Conflicts:
#	packages/attestation-service/package.json
#	packages/faucet/package.json
#	packages/sdk/CHANGELOG.md
#	packages/sdk/identity/package.json
#	packages/sdk/phone-utils/package.json
#	packages/sdk/utils/package.json
#	packages/sdk/utils/src/io.ts
#	yarn.lock
@aaronmgdr aaronmgdr closed this Mar 16, 2022
@mcortesi mcortesi deleted the aaronmgder/utils-breakup branch August 23, 2023 12:51
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.

Break up Utils Package
2 participants