Commit 8f900f4
feat(analytics-js): create lite named export (#2745)
* feat(analytics-js): add cloud-only build configurations and update size limits
- Introduced new size limits for various cloud-only builds (Legacy and Modern) in `.size-limit.mjs`.
- Updated `package.json` to include new entry points for cloud-only builds, specifying types and default exports.
- Modified `rollup.config.mjs` to handle cloud-only builds, including exclusion of device mode plugins and adjusting output paths accordingly.
* chore: rename to lite
* fix(analytics-js): update size limits and adjust plugin bundling logic
- Reduced size limits for various Core (Lite) builds in `.size-limit.mjs` to improve performance.
- Modified `rollup.config.mjs` to refine the logic for bundling plugins based on build type.
* feat(analytics-js): add variant field to event context and optimize lite builds
Adds a variant field to context.library that identifies which npm package export or CDN build variant is being used.
Variant values for NPM builds: modern, legacy, lite, bundled, content-script, and legacy variants of each.
For CDN builds, uses window.rudderAnalyticsBuildType runtime value.
Lite Build Optimizations:
- Excludes 7 plugins to reduce bundle size by ~10 KB (24% legacy, 22% modern)
- Excluded: DeviceModeDestinations, DeviceModeTransformation, NativeDestinationQueue, BeaconQueue, GoogleLinker, StorageEncryptionLegacy, StorageMigrator
- Final sizes: Legacy 38 KB, Modern 33 KB (vs Bundled: 50 KB / 42 KB)
- GoogleLinker excluded from default plugins list in lite builds
- Storage migration disabled by default in lite builds
* chore: fix build flags
* chore: restore const
* chore: add unit tests
* chore: clean up
* chore: update example app
* chore: fix lock file
* chore: update packages/analytics-js/__tests__/state/slices/context.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: update packages/analytics-js/rollup.config.mjs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: add force deploy confirmation and validate PR status in deployment workflow
- Introduced `force_deploy_confirmation` input to allow bypassing all PR checks during deployment.
- Added a new job to check for force deploy mode and validate PR status, ensuring that deployments only proceed if PRs are ready for merging unless forced.
- Enhanced logging for better visibility during the deployment process.
* chore: update deployment workflow to include force deploy mode check
- Modified the condition for the 'get-deploy-inputs' job to allow deployment when 'force_deploy_mode' is true, in addition to validating PR status.
- This change enhances the flexibility of the deployment process by enabling forced deployments under specific conditions.
* chore: refine deployment workflow conditions and add debug logging
- Updated the condition for the 'get-deploy-inputs' job to allow deployment when the validation result is 'skipped', in addition to 'success'.
- Added a debug step to log the results of the 'find-pr' and 'validate-pr' jobs for improved visibility during the deployment process.
* chore: streamline deployment conditions in workflow
- Removed debug logging from the deployment workflow to simplify the process.
- Updated conditions for deployment jobs to ensure they only run if 'get-deploy-inputs' is successful, enhancing reliability in the deployment process.
* chore: enhance deployment workflow with force deploy mode handling
- Removed conditional checks for PR validation and deployment jobs to streamline the process.
- Added logic to skip PR validation checks when force deploy mode is enabled, improving deployment flexibility.
- Updated deployment conditions to focus on essential checks, ensuring a more efficient workflow.
* chore: hardcode package publish
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 2001172 commit 8f900f4
26 files changed
Lines changed: 1101 additions & 435 deletions
File tree
- .github/workflows
- examples/nextjs/ts/sample-app
- src/app
- jest
- packages
- analytics-js-common/src/types
- analytics-js
- __tests__
- components
- configManager
- pluginsManager
- services/ErrorHandler
- state/slices
- src
- components
- configManager
- pluginsManager
- constants
- state/slices
- types
- sanity-suite/src/ignoredProperties
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | | - | |
34 | | - | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
53 | 67 | | |
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | | - | |
| 74 | + | |
61 | 75 | | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
68 | | - | |
| 82 | + | |
69 | 83 | | |
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 87 | + | |
| 88 | + | |
116 | 89 | | |
117 | 90 | | |
118 | 91 | | |
119 | 92 | | |
120 | | - | |
121 | 93 | | |
122 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
123 | 196 | | |
124 | 197 | | |
125 | 198 | | |
| |||
130 | 203 | | |
131 | 204 | | |
132 | 205 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
136 | 209 | | |
137 | 210 | | |
138 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
0 commit comments