Me, myself & I Paul Souche Front End developer @S_A_N_T_E_C_H In love with TypeScript since 2014 @paul.souche paulsouche @paulsouche https://goo.gl/S6Q1Ri
What is segment ? - Basically a big infrastructure dealing with analytics requests at the femtosecond stage - API & SDKs for all your platforms - Import data from all your sources (Mobile / Websites / Applications / Servers) and make it available for any destination (email / analytics / helpdesks...) https://goo.gl/S6Q1Ri
Getting started umd bundle 289 Ko for analytics ! All we want is http POST a dto ! For comparison angular.min.js ~ 165 Ko jquery.min.js ~ 85 Ko https://goo.gl/S6Q1Ri
Issues - Can’t have a 289Ko snippet loaded on mobile & tablet - Write key on the client - Don’t care about all integrations - Can’t hack segment integration to POST on our backend https://goo.gl/S6Q1Ri
What if webpack ? analytics.js is the segment JavaScript library. Can’t get rid of all integrations with it Can’t hack segment integration with it Hacks inside ! Deprecations under the hood ! https://goo.gl/S6Q1Ri
But how does it work afterall ? 2 core libraries : - Analytics.js-core (facade) - analytics.js-integration All integrations - analytics.js-integration-segmentio https://goo.gl/S6Q1Ri
Conclusion - Can’t have a 289Ko snippet loaded on mobile & tablet Bundle is now 84Ko in app bundle - Don’t care about all integrations - Can’t hack segment integration to POST on our backend Only one integration : mine https://goo.gl/S6Q1Ri