Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.2.1
chore: build target raised from es2018 to es2022, matching the browsers that ship a native <dialog>
chore: replaced the deprecated jQuery `.click()` shorthand with `.on('click')`/`.trigger('click')`, so the library is clean under jQuery 4
chore: npm audit fix for brace-expansion, nanoid, postcss and undici (transitive dev dependencies)

## 2.2.0
fix: the dialog no longer blinks out and back in before its exit animation; the closing state is now set before the native close, which fires its event asynchronously
feat: optional custom-elements bundle so Safari/WebKit can use <dialog is="bahamut-dialogify">
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,13 @@ exposes `window.dialogPolyfill`, which dialogify detects at runtime:

## Dependencies

- [jQuery](https://jquery.com/) (peer dependency, `>=3.0.0`)
- [jQuery](https://jquery.com/) (peer dependency, `>=3.0.0`, jQuery 4 included)

## Browser compatibility

All modern browser
Every browser with a native `<dialog>` element (Chrome 94+, Firefox 98+,
Safari 15.4+); the bundles are built for `es2022`. Older browsers can load the
optional `dialog-polyfill` bundle.

## Designed by

Expand Down
14 changes: 9 additions & 5 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { replace } from 'esbuild-plugin-replace';

const jqueryGlobalShim = path.resolve('src/js/jquery-global.js');

// Matches the browsers that ship a native <dialog> element (Chrome 94+,
// Firefox 98+, Safari 15.4+), so nothing is downlevelled needlessly.
const TARGET = ['es2022'];

// Build the CSS once, reuse for the standalone file and the embedded builds.
async function buildCss() {
const result = await esbuild.build({
Expand Down Expand Up @@ -51,7 +55,7 @@ async function buildJs(cssLiteral) {
sourcemap: true,
format: 'iife',
outfile: 'dist/dialogify.min.js',
target: ['es2018'],
target: TARGET,
alias: { jquery: jqueryGlobalShim },
plugins: [cssReplace]
});
Expand All @@ -64,7 +68,7 @@ async function buildJs(cssLiteral) {
sourcemap: true,
format: 'esm',
outfile: 'dist/dialogify.mjs',
target: ['es2018'],
target: TARGET,
external: ['jquery'],
plugins: [cssReplace]
});
Expand All @@ -79,7 +83,7 @@ async function buildJs(cssLiteral) {
sourcemap: true,
format: 'cjs',
outfile: 'dist/dialogify.cjs',
target: ['es2018'],
target: TARGET,
external: ['jquery'],
footer: {
js: 'if(module.exports&&module.exports.default){module.exports=module.exports.default}'
Expand All @@ -97,7 +101,7 @@ async function buildPolyfill() {
sourcemap: true,
format: 'iife',
outfile: 'dist/dialog-polyfill.min.js',
target: ['es2018']
target: TARGET
});

// Customized built-in elements polyfill for Safari/WebKit, needed only for
Expand All @@ -109,7 +113,7 @@ async function buildPolyfill() {
sourcemap: true,
format: 'iife',
outfile: 'dist/custom-elements.min.js',
target: ['es2018']
target: TARGET
});
}

Expand Down
4 changes: 2 additions & 2 deletions dist/custom-elements.min.js

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

4 changes: 2 additions & 2 deletions dist/custom-elements.min.js.map

Large diffs are not rendered by default.

Loading
Loading