Skip to content

Breakup Utils Package (Breaking change)#8987

Closed
aaronmgdr wants to merge 15 commits intomasterfrom
aaronmgder/utils-breakup
Closed

Breakup Utils Package (Breaking change)#8987
aaronmgdr wants to merge 15 commits intomasterfrom
aaronmgder/utils-breakup

Conversation

@aaronmgdr
Copy link
Copy Markdown
Contributor

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