Major version bump
Summary
- Setup the base config to support vitest
- Update to node v18
- Update to latest major version of TypeScript (5)
- Other dev dependency updates
- Removed jest support
- Changed import and export statements into ES6 syntax inside the
/srcdirectory. - Created
index.tsfile as the entry point to the library. This is a breaking change, and the import statements to use our modules will now change:import { isChrome, isSafari } from @braintree/browser-detection - Removed necessary files so we are not referencing the
distdirectory directly from the source code.
Why Vitest
Vitest is a "blazingly fast" unit test framework, and allows us to leave the test suite running in a watch-mode environment while we continue to make changes to our code. Only the necessary tests will re-run depending on what files were changed, making it much quicker to make changes without having to wait for the entire test suite to re-run.
Vitest has also been designed with a Jest compatible API, in order to make the migration from Jest as simple as possible. The API is essentially the same as Jest with some very minor differences.
Why Create index.ts as the entry point
- Removes the risk of circular dependencies (we currently have some modules that rely on others)
- Easier to add or remove additional imports
- Allows us to remove any references to the
distfolder from the source code - Consistency across some of our other repositories
Checklist
- [X] Added a changelog entry
Authors
List GitHub usernames for everyone who contributed to this pull request.
- @oscarleonnogales
Question for the team: We've talked about potentially deprecating support for Internet Explorer. Given that we have 4 modules testing for different versions, should we:
- Completely remove all IE modules and tests from this library
- Consolidate the existing IE modules and create a single
isInternetExplorermodule - Leave the existing IE modules as they are.
Question for the team: We've talked about potentially deprecating support for Internet Explorer. Given that we have 4 modules testing for different versions, should we:
- Completely remove all IE modules and tests from this library
- Consolidate the existing IE modules and create a single
isInternetExplorermodule- Leave the existing IE modules as they are.
I think we can leave them as-is since someone else might be able to find those useful.