Skip to content

Commit

Permalink
fix: upgrade esbuild. simple class static props
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Jun 17, 2023
1 parent 5ece15a commit 1029ec7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"esbuild": "^0.17.11",
"wet-run": "^0.0.7"
"esbuild": "^0.18.4",
"wet-run": "^0.2.0"
},
"eslintConfig": {
"root": true,
Expand Down
7 changes: 2 additions & 5 deletions src/option.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ template.innerHTML = /* html */`
`;

class OptionElement extends globalThis.HTMLElement {
static formAssociated = true;
static observedAttributes = ['disabled', 'selected'];
/** @see https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-dirtiness */
#dirty = false;
#internals;
Expand Down Expand Up @@ -143,11 +145,6 @@ class OptionElement extends globalThis.HTMLElement {
}
}

// Define as an external static so esbuild doesn't add unnecessary transforms
// see https://github.com/evanw/esbuild/issues/2416
OptionElement.formAssociated = true;
OptionElement.observedAttributes = ['disabled', 'selected'];

if (!globalThis.customElements.get('x-option')) {
globalThis.customElements.define('x-option', OptionElement);
}
Expand Down
7 changes: 2 additions & 5 deletions src/selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ template.innerHTML = /* html */`
`;

class SelectMenuElement extends globalThis.HTMLElement {
static formAssociated = true;
static observedAttributes = ['disabled', 'required', 'multiple'];
#internals;

constructor() {
Expand Down Expand Up @@ -462,11 +464,6 @@ class SelectMenuElement extends globalThis.HTMLElement {
}
}

// Define as an external static so esbuild doesn't add unnecessary transforms
// see https://github.com/evanw/esbuild/issues/2416
SelectMenuElement.formAssociated = true;
SelectMenuElement.observedAttributes = ['disabled', 'required', 'multiple'];

function reposition(reference, popover) {

let { style } = getCSSRule(reference.shadowRoot,
Expand Down

1 comment on commit 1029ec7

@vercel
Copy link

@vercel vercel bot commented on 1029ec7 Jun 17, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

selectmenu-polyfill – ./

selectmenu-polyfill-git-main-luwes.vercel.app
selectmenu-polyfill-luwes.vercel.app
selectmenu-polyfill.vercel.app

Please sign in to comment.