Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 17, 2024
1 parent a551cdd commit 9f8b030
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"presets": ["@babel/env", ["@babel/typescript", { "jsxPragma": "h" }]],
"plugins": [
"@babel/plugin-transform-nullish-coalescing-operator",
[
"@babel/transform-react-jsx",
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,3 @@ jobs:

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

- name: Run es-check to check if our array bundle is ES6 compatible
run: npx [email protected] es6 dist/array.js

- name: Run es-check to check if our main bundle is ES6 compatible
run: npx [email protected] es6 dist/main.js
1 change: 1 addition & 0 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-nullish-coalescing-operator": "^7.25.8",
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/preset-env": "7.18.9",
"@babel/preset-typescript": "^7.18.6",
Expand Down
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const plugins = (supportIE11) => [
babel({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
babelHelpers: 'bundled',
plugins: ['@babel/plugin-transform-nullish-coalescing-operator'],
presets: [
[
'@babel/preset-env',
Expand All @@ -23,12 +24,18 @@ const plugins = (supportIE11) => [
? '>0.5%, last 2 versions, Firefox ESR, not dead, IE 11'
: '>0.5%, last 2 versions, Firefox ESR, not dead',
useBuiltIns: supportIE11 ? 'usage' : false,
corejs: '3.38',
corejs: supportIE11 ? '3.38' : undefined,
},
],
],
}),
terser({ toplevel: true }),
terser({
toplevel: true,
compress: {
// 5 is the default if unspecified
ecma: supportIE11 ? 5 : 6,
},
}),
]

const entrypoints = fs.readdirSync('./src/entrypoints')
Expand Down
13 changes: 8 additions & 5 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const cookieStore: PersistentStore = {
return decodeURIComponent(c.substring(nameEQ.length, c.length))
}
}
} catch {}
} catch {
// noop
}
return null
},

Expand Down Expand Up @@ -159,17 +161,16 @@ export const cookieStore: PersistentStore = {
}

document.cookie = new_cookie_val
return new_cookie_val
} catch {
return
// no-op
}
},

remove: function (name, cross_subdomain) {
try {
cookieStore.set(name, '', -1, cross_subdomain)
} catch {
return
// no-op
}
},
}
Expand Down Expand Up @@ -258,7 +259,9 @@ export const localPlusCookieStore: PersistentStore = {
try {
// See if there's a cookie stored with data.
cookieProperties = cookieStore.parse(name) || {}
} catch {}
} catch {
// noop
}
const value = extend(cookieProperties, JSON.parse(localStore.get(name) || '{}'))
localStore.set(name, value)
return value
Expand Down

0 comments on commit 9f8b030

Please sign in to comment.