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

chore: add recorder to es5 bundle #1499

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion .github/workflows/testcafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
include:
- browser: 'chrome:headless'
name: Chrome
cli: ''
- browser: 'firefox:headless'
name: Firefox
cli: ''
- browser: 'browserstack:ie'
name: IE11
cli: '--skip-js-errors'
- browser: 'browserstack:safari'
name: Safari
cli: ''

steps:
- uses: actions/checkout@v4
Expand All @@ -58,7 +62,7 @@ jobs:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
RUN_ID: ${{ github.run_id }}
BROWSER: ${{ matrix.browser }}
run: pnpm testcafe ${{ matrix.browser }} --stop-on-first-fail
run: pnpm testcafe ${{ matrix.browser }} --stop-on-first-fail ${{ matrix.cli }}

- name: Check ${{ matrix.name }} events
run: pnpm check-testcafe-results
59 changes: 31 additions & 28 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,37 @@ import commonjs from '@rollup/plugin-commonjs'
import fs from 'fs'
import path from 'path'

const plugins = (es5) => [
json(),
resolve({ browser: true }),
typescript({ sourceMap: true, outDir: './dist' }),
commonjs(),
babel({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
babelHelpers: 'bundled',
plugins: ['@babel/plugin-transform-nullish-coalescing-operator'],
presets: [
[
'@babel/preset-env',
{
targets: es5
? '>0.5%, last 2 versions, Firefox ESR, not dead, IE 11'
: '>0.5%, last 2 versions, Firefox ESR, not dead',
},
],
],
}),
terser({
toplevel: true,
compress: {
// 5 is the default if unspecified
ecma: es5 ? 5 : 6,
},
}),
]
const plugins = (es5) => {
const babelOptions = {
targets: es5
? '>0.5%, last 2 versions, Firefox ESR, not dead, IE 11'
: '>0.5%, last 2 versions, Firefox ESR, not dead',
}
if (es5) {
babelOptions.useBuiltIns = 'usage'
babelOptions.corejs = 3
}

return [
json(),
resolve({ browser: true }),
typescript({ sourceMap: true, outDir: './dist' }),
commonjs(),
babel({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
babelHelpers: 'bundled',
plugins: ['@babel/plugin-transform-nullish-coalescing-operator'],
presets: [['@babel/preset-env', babelOptions]],
}),
terser({
toplevel: true,
compress: {
// 5 is the default if unspecified
ecma: es5 ? 5 : 6,
},
}),
]
}

const entrypoints = fs.readdirSync('./src/entrypoints')

Expand Down
4 changes: 2 additions & 2 deletions src/entrypoints/array.full.es5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// but will have different config when passed through rollup
// to allow es5/IE11 support

// it doesn't include recorder which doesn't support IE11,
// and it doesn't include web-vitals which doesn't support IE11
// but it doesn't include web-vitals which doesn't support IE11

import './surveys'
import './exception-autocapture'
import './tracing-headers'
import './recorder'
import './array.no-external'
Loading