Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve ES6 bundling and support #1525

Closed
wants to merge 19 commits into from
Closed

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Nov 14, 2024

we can be much more explicit about what we support
and test that the bundle is ES6 only
which will extend browser support by >10% of global audience

Copy link

vercel bot commented Nov 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 19, 2024 11:45am

Copy link

github-actions bot commented Nov 14, 2024

Size Change: +16.3 kB (+0.53%)

Total Size: 3.13 MB

Filename Size Change
dist/all-external-dependencies.js 206 kB +1.46 kB (+0.71%)
dist/array.full.js 357 kB +1.24 kB (+0.35%)
dist/array.full.no-external.js 356 kB +1.21 kB (+0.34%)
dist/array.js 171 kB +826 B (+0.49%)
dist/array.no-external.js 170 kB +802 B (+0.47%)
dist/dead-clicks-autocapture.js 14.3 kB +707 B (+5.21%) 🔍
dist/exception-autocapture.js 9.36 kB +657 B (+7.55%) 🔍
dist/external-scripts-loader.js 2.22 kB +28 B (+1.28%)
dist/main.js 172 kB +842 B (+0.49%)
dist/module.full.js 357 kB +1.24 kB (+0.35%)
dist/module.full.no-external.js 356 kB +1.21 kB (+0.34%)
dist/module.js 171 kB +842 B (+0.49%)
dist/module.no-external.js 170 kB +820 B (+0.48%)
dist/recorder-v2.js 114 kB +1.08 kB (+0.96%)
dist/recorder.js 114 kB +1.08 kB (+0.96%)
dist/surveys-preview.js 57.5 kB +911 B (+1.61%)
dist/surveys.js 63.1 kB +1.03 kB (+1.66%)
dist/tracing-headers.js 1.68 kB +354 B (+26.64%) 🚨
dist/web-vitals.js 10.3 kB -8 B (-0.08%)
ℹ️ View Unchanged
Filename Size
dist/array.full.es5.js 253 kB

compressed-size-action

@pauldambra
Copy link
Member Author

oh, very interesting that makes tests fail 🤯

@pauldambra pauldambra changed the title chore: remove IE11 from main browserlist declaration fix: improve browserslist declaration Nov 16, 2024
@pauldambra pauldambra changed the title fix: improve browserslist declaration fix: improve ES6 bundling and support Nov 16, 2024
package.json Outdated Show resolved Hide resolved
rollup.config.js Outdated
Comment on lines 23 to 24
// Explicitly included so we transform 1 ** 2 to Math.pow(1, 2) for ES6 compatability
'@babel/plugin-transform-exponentiation-operator',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the browsers to support navigator.webdriver was tricking babel into thinking some ES2017 features were ok
including this forces babel to transform this

Copy link

@ioannisj ioannisj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low context approval from me. I guess the only questions is if docs need to be updated or not

rollup.config.js Outdated Show resolved Hide resolved
"safari > 12"
],
"es5": [
"defaults",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious as to what defaults mean: https://github.com/browserslist/browserslist?tab=readme-ov-file#full-list

Can we put an old version of ios_saf here? I would guess that it's not needed given how much support IE11 would need, but it'd be better to be explicit. TBH I think we could copy the whole list above, given that these are ORd together, so there's no harm in adding versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-11-19 at 10 43 25 also TIL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious as to what defaults

"defaults" is just short-hand for the values we used to explicitly set.

I think we could copy the whole list above, given that these are ORd together, so there's no harm in adding versions.

i've been fiddling with this to get CI to pass 🙈

i don't understand why IE 11 is freezing in testcafe now so have been changing values around 🫠

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i agree the explicit list is better than "defaults" just hitting it with a hammer to try and understand what's happening :))

@pauldambra
Copy link
Member Author

this failing IE 11 test is super annoying -> #1542

@pauldambra pauldambra closed this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants