browser-detection icon indicating copy to clipboard operation
browser-detection copied to clipboard

Major version bump

Open oscarleonnogales opened this issue 2 years ago • 2 comments

JIRA

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 /src directory.
  • Created index.ts file 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 dist directory 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 dist folder 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

oscarleonnogales avatar Aug 29 '23 17:08 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:

  1. Completely remove all IE modules and tests from this library
  2. Consolidate the existing IE modules and create a single isInternetExplorer module
  3. Leave the existing IE modules as they are.

oscarleonnogales avatar Aug 29 '23 17:08 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:

  1. Completely remove all IE modules and tests from this library
  2. Consolidate the existing IE modules and create a single isInternetExplorer module
  3. 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.

jplukarski avatar Jan 04 '24 17:01 jplukarski