Skip to content

Commit

Permalink
Hotfix: error on component define if no mixins defined
Browse files Browse the repository at this point in the history
  • Loading branch information
kgscialdone committed Jan 6, 2024
1 parent cc69a4b commit 52941ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Facet is a single-file web library that allows for the easy, declarative definit
## Installation
You can download `facet.min.js` from this repository and reference it locally, or retrieve it directly from a CDN like JSDelivr. Facet will automatically detect component definitions in your page's HTML and convert them into web components.
```html
<script src="https://cdn.jsdelivr.net/gh/kgscialdone/[email protected].2/facet.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kgscialdone/[email protected].2a/facet.min.js"></script>
```

## Defining Components
Expand Down
8 changes: 5 additions & 3 deletions facet.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Facet v0.1.2 | https://github.com/kgscialdone/facet
// Facet v0.1.2a | https://github.com/kgscialdone/facet

/** Facet Javascript API */
const facet = new function() {
this.version = '0.1.2'
this.version = '0.1.2a'

/**
* Define a Facet component. This is primarily for internal use; it can be called manually to define
Expand Down Expand Up @@ -119,7 +119,7 @@ const facet = new function() {
* @param {{[name:string]:(host:FacetComponent,root:(FacetComponent|ShadowRoot),value:string)=>string}} [options.localFilters={}] An object containing local filter functions (default: {}).
*/
this.defineMixin = function defineMixin(name, template, options) {
(this.mixins ??= {})[name] = { ...options, name, template }
this.mixins[name] = { ...options, name, template }
}

/**
Expand Down Expand Up @@ -161,6 +161,8 @@ const facet = new function() {
}
}

/** Defined mixins */
this.mixins = {}
/** Configuration options */
this.config = {
/** If set, prepends a namespace to the `component` and `mixin` magic attributes to reduce conflicts.
Expand Down
4 changes: 2 additions & 2 deletions facet.min.js

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

0 comments on commit 52941ee

Please sign in to comment.