Skip to content

Commit c0fd057

Browse files
committed
Updates
updates to use native modules
1 parent dc589c1 commit c0fd057

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

index.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
<html lang="en">
33
<title>Parcel Sandbox</title>
44
<meta charset="UTF-8" />
5+
<link rel="stylesheet" href="./src/style.css">
56

67
<h1>🧛🏻‍♂️ Haunted App 🎃</h1>
78
<my-app></my-app>
89

9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.2.4/custom-elements-es5-adapter.js">
10-
</script>
11-
<script src="src/index.js">
12-
13-
</script>
10+
<script type="module" src="src/index.js"></script>

package.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
"version": "1.0.0",
44
"description": "A project for creating apps with Haunted and lit-html.",
55
"main": "index.html",
6-
"scripts": {
7-
"start": "parcel index.html --open",
8-
"build": "parcel build index.html"
9-
},
6+
"scripts": {},
107
"dependencies": {
11-
"haunted": "^4.1.2",
12-
"lit-html": "^1.0.0"
13-
},
14-
"devDependencies": {
15-
"parcel-bundler": "^1.6.1"
8+
"haunted": "4.5.1",
9+
"lit-html": "1.1.1"
1610
},
1711
"keywords": ["web-components", "lit-html"]
1812
}

sandbox.config.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"infiniteLoopProtection": true,
33
"hardReloadOnChange": true,
4-
"view": "browser"
5-
}
4+
"view": "browser",
5+
"template": "static"
6+
}

src/FullName.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import { component, useState } from "haunted";
2-
import { html } from "lit-html";
1+
import {
2+
component,
3+
html,
4+
useState
5+
} from "https://unpkg.com/haunted/haunted.js";
36

47
function dispatch(el, first, last) {
58
let event = new CustomEvent("change", {

src/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { component, useState, html } from "haunted";
2-
1+
import {
2+
component,
3+
useState,
4+
html
5+
} from "https://unpkg.com/haunted/haunted.js";
36
import "./FullName.js";
4-
import "./style.css";
57

68
function App() {
79
const [name, setName] = useState("");

0 commit comments

Comments
 (0)