Skip to content

Commit

Permalink
Just remove decorators altogether (still causing downstream build iss…
Browse files Browse the repository at this point in the history
…ues)
  • Loading branch information
jaredcwhite committed Jul 30, 2024
1 parent f62fc77 commit 08b72dc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.0.2 / 2024-07-30

* Just remove decorators altogether (still causing downstream build issues)

## 3.0.1 / 2024-07-30

* Ensure esbuild output compiles away decorators
Expand Down
28 changes: 21 additions & 7 deletions frontend/javascript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import "bridgetown-quick-search"
*/
import { LitElement, css, html } from "lit"
import { customElement, property } from "lit/decorators.js"
import { unsafeHTML } from "lit/directives/unsafe-html.js"
import SearchEngine from "./search_engine"

@customElement("bridgetown-search-form")
export class BridgetownSearchForm extends LitElement {
static {
customElements.define("bridgetown-search-form", this)
}

render() {
return html`<form><slot name="input"></slot></form><slot></slot>`
}
Expand All @@ -27,12 +29,24 @@ export class BridgetownSearchForm extends LitElement {
}
}

@customElement("bridgetown-search-results")
export class BridgetownSearchResults extends LitElement {
@property({ type: String }) theme
@property({ type: Array }) results = []
@property({ type: Number }) snippetLength = 142
@property({ type: Boolean }) displayCollection = false
static {
customElements.define("bridgetown-search-results", this)
}

static properties = {
theme: { type: String },
results: { type: Array },
snippetLength: { type: Number },
displayCollection: { type: Boolean },
}

constructor () {
super()
this.results = []
this.snippetLength = 142
this.displayCollection = false
}

static styles = css`
:host {
Expand Down
2 changes: 1 addition & 1 deletion lib/bridgetown-quick-search/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Bridgetown
module QuickSearch
VERSION = "3.0.1"
VERSION = "3.0.2"
end
end
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridgetown-quick-search",
"version": "3.0.1",
"version": "3.0.2",
"main": "frontend/dist/index.js",
"exports": {
".": "./frontend/dist/index.js",
Expand All @@ -25,7 +25,7 @@
"frontend"
],
"scripts": {
"build": "esbuild frontend/javascript/index.js --bundle --outdir=frontend/dist --format=esm --supported:decorators=false"
"build": "esbuild frontend/javascript/index.js --bundle --outdir=frontend/dist --format=esm"
},
"dependencies": {
"lit": "^3.1.0",
Expand Down

0 comments on commit 08b72dc

Please sign in to comment.