BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
287 stars 101 forks source link

[SDK-1660] Change compiler config to ECMASCRIPT_2015 #824

Closed JagadeeshKaricherla-branch closed 1 year ago

JagadeeshKaricherla-branch commented 1 year ago

Pull Request Template

Description

After our closure compiler upgrade (https://github.com/BranchMetrics/web-branch-deep-linking-attribution/pull/805 ) , there were issues observed with branch web sdk loading on old browsers (2015-2018 released browsers) like safari 12.

Root cause : Our current closure compiler out language is set to default which is stable. So the output ( build.js) bundle is ECMASCRIPT 2019 compatible which means the output file can contain advanced ES6 code features not supported on older browsers. One example of the feature thats there in our output file that older browsers don’t support is the logical OR assignment

image

Fix : we changed the closure config to output ECMASCRIPT_2015 compatible code which is supported by the min version of browser that our web sdk supports today.

before : b || = {}; a || = {};

after :

image

On the downside, the output bundle size has increased.In the future, as we deprecate support for older browsers we will change the language out accordingly to more modern versions.

Fixes # (issue) : SDK-1660

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

JS Budget Check

Please mention the size in kb before abd after this PR

Files Before After
dist/build.js. 161kb 169kb
dist/build.min.js 73kb 79kb

Checklist:

Mentions:

List the person or team responsible for reviewing proposed changes.