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
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/es-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ jobs:

- name: Run es-check to check if our ie11 bundle is ES5 compatible
run: npx [email protected] es5 dist/array.full.es5.js

- name: Run es-check to check if our main bundle is ES6 compatible
run: npx [email protected] es6 dist/array.full.js
35 changes: 30 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"devDependencies": {
"@babel/core": "7.18.9",
"@babel/plugin-syntax-decorators": "^7.23.3",
"@babel/plugin-transform-exponentiation-operator": "^7.25.9",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.8",
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/preset-env": "7.18.9",
Expand Down Expand Up @@ -74,14 +75,15 @@
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"babel-jest": "^26.6.3",
"browserslist": "^4.24.2",
"compare-versions": "^6.1.0",
"cypress": "13.6.3",
"cypress": "13.15.2",
"cypress-localstorage-commands": "^2.2.6",
"date-fns": "^3.6.0",
"eslint": "8.57.0",
"eslint-config-posthog-js": "link:eslint-rules",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-compat": "^6.0.1",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-posthog-js": "link:eslint-rules",
Expand Down Expand Up @@ -121,9 +123,32 @@
"eslint cypress --fix"
]
},
"browserslist": [
"> 0.5%, last 2 versions, Firefox ESR, not dead, IE 11"
],
"browserslist": {
"production": [
"defaults",
"supports es6-module",
"chrome > 62",
"firefox > 59",
"ios_saf >= 10.3",
"opera > 50",
"not chrome 61",
"not opera 48",
"not chrome 62",
"not opera 49"
pauldambra marked this conversation as resolved.
Show resolved Hide resolved
],
"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 :))

"chrome > 62",
"firefox > 59",
"ios_saf >= 10.3",
"opera > 50",
"not chrome 61",
"not opera 48",
"not chrome 62",
"not opera 49",
"IE 11"
]
},
"pnpm": {
"patchedDependencies": {
"@rrweb/[email protected]": "patches/@[email protected]",
Expand Down
Loading
Loading