├── .gitattributes ├── .gitignore ├── .prettierrc ├── README.md ├── dist ├── base.css ├── base.js ├── bundle.js ├── index.css └── index.html ├── package.json ├── pnpm-lock.yaml ├── rollup.config.js ├── src └── index.tsx └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ## GITATTRIBUTES FOR WEB PROJECTS 2 | # from: https://github.com/alexkaratarakis/gitattributes/pull/143 3 | # 4 | # These settings are for any web project. 5 | # 6 | # Details per file setting: 7 | # text These files should be normalized (i.e. convert CRLF to LF). 8 | # binary These files are binary and should be left untouched. 9 | # 10 | # Note that binary is a macro for -text -diff. 11 | ###################################################################### 12 | 13 | # Auto detect 14 | ## Handle line endings automatically for files detected as 15 | ## text and leave all files detected as binary untouched. 16 | ## This will handle all files NOT defined below. 17 | * text=auto 18 | 19 | # Source code 20 | *.bash text eol=lf 21 | *.bat text eol=crlf 22 | *.cmd text eol=crlf 23 | *.coffee text 24 | *.css text diff=css 25 | *.htm text diff=html 26 | *.html text diff=html 27 | *.inc text 28 | *.ini text 29 | *.js text 30 | *.json text 31 | *.jsx text 32 | *.less text 33 | *.ls text 34 | *.map text -diff 35 | *.od text 36 | *.onlydata text 37 | *.php text diff=php 38 | *.pl text 39 | *.ps1 text eol=crlf 40 | *.py text diff=python 41 | *.rb text diff=ruby 42 | *.sass text 43 | *.scm text 44 | *.scss text diff=css 45 | *.sh text eol=lf 46 | *.sql text 47 | *.styl text 48 | *.tag text 49 | *.ts text 50 | *.tsx text 51 | *.xml text 52 | *.xhtml text diff=html 53 | 54 | # Docker 55 | Dockerfile text 56 | 57 | # Documentation 58 | *.ipynb text 59 | *.markdown text diff=markdown 60 | *.md text diff=markdown 61 | *.mdwn text diff=markdown 62 | *.mdown text diff=markdown 63 | *.mkd text diff=markdown 64 | *.mkdn text diff=markdown 65 | *.mdtxt text 66 | *.mdtext text 67 | *.txt text 68 | AUTHORS text 69 | CHANGELOG text 70 | CHANGES text 71 | CONTRIBUTING text 72 | COPYING text 73 | copyright text 74 | *COPYRIGHT* text 75 | INSTALL text 76 | license text 77 | LICENSE text 78 | NEWS text 79 | readme text 80 | *README* text 81 | TODO text 82 | 83 | # Templates 84 | *.dot text 85 | *.ejs text 86 | *.haml text 87 | *.handlebars text 88 | *.hbs text 89 | *.hbt text 90 | *.jade text 91 | *.latte text 92 | *.mustache text 93 | *.njk text 94 | *.phtml text 95 | *.svelte text 96 | *.tmpl text 97 | *.tpl text 98 | *.twig text 99 | *.vue text 100 | 101 | # Configs 102 | *.cnf text 103 | *.conf text 104 | *.config text 105 | .editorconfig text 106 | .env text 107 | .gitattributes text 108 | .gitconfig text 109 | .htaccess text 110 | *.lock text -diff 111 | package.json text eol=lf 112 | package-lock.json text eol=lf -diff 113 | pnpm-lock.yaml text eol=lf -diff 114 | .prettierrc text 115 | yarn.lock text -diff 116 | *.toml text 117 | *.yaml text 118 | *.yml text 119 | browserslist text 120 | Makefile text 121 | makefile text 122 | 123 | # Heroku 124 | Procfile text 125 | 126 | # Graphics 127 | *.ai binary 128 | *.bmp binary 129 | *.eps binary 130 | *.gif binary 131 | *.gifv binary 132 | *.ico binary 133 | *.jng binary 134 | *.jp2 binary 135 | *.jpg binary 136 | *.jpeg binary 137 | *.jpx binary 138 | *.jxr binary 139 | *.pdf binary 140 | *.png binary 141 | *.psb binary 142 | *.psd binary 143 | # SVG treated as an asset (binary) by default. 144 | *.svg text 145 | # If you want to treat it as binary, 146 | # use the following line instead. 147 | # *.svg binary 148 | *.svgz binary 149 | *.tif binary 150 | *.tiff binary 151 | *.wbmp binary 152 | *.webp binary 153 | 154 | # Audio 155 | *.kar binary 156 | *.m4a binary 157 | *.mid binary 158 | *.midi binary 159 | *.mp3 binary 160 | *.ogg binary 161 | *.ra binary 162 | 163 | # Video 164 | *.3gpp binary 165 | *.3gp binary 166 | *.as binary 167 | *.asf binary 168 | *.asx binary 169 | *.avi binary 170 | *.fla binary 171 | *.flv binary 172 | *.m4v binary 173 | *.mng binary 174 | *.mov binary 175 | *.mp4 binary 176 | *.mpeg binary 177 | *.mpg binary 178 | *.ogv binary 179 | *.swc binary 180 | *.swf binary 181 | *.webm binary 182 | 183 | # Archives 184 | *.7z binary 185 | *.gz binary 186 | *.jar binary 187 | *.rar binary 188 | *.tar binary 189 | *.zip binary 190 | 191 | # Fonts 192 | *.ttf binary 193 | *.eot binary 194 | *.otf binary 195 | *.woff binary 196 | *.woff2 binary 197 | 198 | # Executables 199 | *.exe binary 200 | *.pyc binary 201 | 202 | # RC files (like .babelrc or .eslintrc) 203 | *.*rc text 204 | 205 | # Ignore files (like .npmignore or .gitignore) 206 | *.*ignore text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "none", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": false, 6 | "printWidth": 100 7 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solid TodoMVC 2 | 3 | Solid implementation of TodoMVC example application. 4 | 5 | Try it [here](https://ryansolid.github.io/solid-todomvc). 6 | 7 | ## Running Locally: 8 | This project uses rollup without a web-server. To run it locally simply point your web browser to the `dist/index.html` file. 9 | 10 | You can either paste the absolute path into the address bar, or right click the file and select to open with your favorite web browser. -------------------------------------------------------------------------------- /dist/base.css: -------------------------------------------------------------------------------- 1 | hr { 2 | margin: 20px 0; 3 | border: 0; 4 | border-top: 1px dashed #c5c5c5; 5 | border-bottom: 1px dashed #f7f7f7; 6 | } 7 | 8 | .learn a { 9 | font-weight: normal; 10 | text-decoration: none; 11 | color: #b83f45; 12 | } 13 | 14 | .learn a:hover { 15 | text-decoration: underline; 16 | color: #787e7e; 17 | } 18 | 19 | .learn h3, 20 | .learn h4, 21 | .learn h5 { 22 | margin: 10px 0; 23 | font-weight: 500; 24 | line-height: 1.2; 25 | color: #000; 26 | } 27 | 28 | .learn h3 { 29 | font-size: 24px; 30 | } 31 | 32 | .learn h4 { 33 | font-size: 18px; 34 | } 35 | 36 | .learn h5 { 37 | margin-bottom: 0; 38 | font-size: 14px; 39 | } 40 | 41 | .learn ul { 42 | padding: 0; 43 | margin: 0 0 30px 25px; 44 | } 45 | 46 | .learn li { 47 | line-height: 20px; 48 | } 49 | 50 | .learn p { 51 | font-size: 15px; 52 | font-weight: 300; 53 | line-height: 1.3; 54 | margin-top: 0; 55 | margin-bottom: 0; 56 | } 57 | 58 | #issue-count { 59 | display: none; 60 | } 61 | 62 | .quote { 63 | border: none; 64 | margin: 20px 0 60px 0; 65 | } 66 | 67 | .quote p { 68 | font-style: italic; 69 | } 70 | 71 | .quote p:before { 72 | content: '“'; 73 | font-size: 50px; 74 | opacity: .15; 75 | position: absolute; 76 | top: -20px; 77 | left: 3px; 78 | } 79 | 80 | .quote p:after { 81 | content: '”'; 82 | font-size: 50px; 83 | opacity: .15; 84 | position: absolute; 85 | bottom: -42px; 86 | right: 3px; 87 | } 88 | 89 | .quote footer { 90 | position: absolute; 91 | bottom: -40px; 92 | right: 0; 93 | } 94 | 95 | .quote footer img { 96 | border-radius: 3px; 97 | } 98 | 99 | .quote footer a { 100 | margin-left: 5px; 101 | vertical-align: middle; 102 | } 103 | 104 | .speech-bubble { 105 | position: relative; 106 | padding: 10px; 107 | background: rgba(0, 0, 0, .04); 108 | border-radius: 5px; 109 | } 110 | 111 | .speech-bubble:after { 112 | content: ''; 113 | position: absolute; 114 | top: 100%; 115 | right: 30px; 116 | border: 13px solid transparent; 117 | border-top-color: rgba(0, 0, 0, .04); 118 | } 119 | 120 | .learn-bar > .learn { 121 | position: absolute; 122 | width: 272px; 123 | top: 8px; 124 | left: -300px; 125 | padding: 10px; 126 | border-radius: 5px; 127 | background-color: rgba(255, 255, 255, .6); 128 | transition-property: left; 129 | transition-duration: 500ms; 130 | } 131 | 132 | @media (min-width: 899px) { 133 | .learn-bar { 134 | width: auto; 135 | padding-left: 300px; 136 | } 137 | 138 | .learn-bar > .learn { 139 | left: 8px; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /dist/base.js: -------------------------------------------------------------------------------- 1 | /* global _ */ 2 | (function () { 3 | 'use strict'; 4 | 5 | /* jshint ignore:start */ 6 | // Underscore's Template Module 7 | // Courtesy of underscorejs.org 8 | var _ = (function (_) { 9 | _.defaults = function (object) { 10 | if (!object) { 11 | return object; 12 | } 13 | for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) { 14 | var iterable = arguments[argsIndex]; 15 | if (iterable) { 16 | for (var key in iterable) { 17 | if (object[key] == null) { 18 | object[key] = iterable[key]; 19 | } 20 | } 21 | } 22 | } 23 | return object; 24 | }; 25 | 26 | // By default, Underscore uses ERB-style template delimiters, change the 27 | // following template settings to use alternative delimiters. 28 | _.templateSettings = { 29 | evaluate : /<%([\s\S]+?)%>/g, 30 | interpolate : /<%=([\s\S]+?)%>/g, 31 | escape : /<%-([\s\S]+?)%>/g 32 | }; 33 | 34 | // When customizing `templateSettings`, if you don't want to define an 35 | // interpolation, evaluation or escaping regex, we need one that is 36 | // guaranteed not to match. 37 | var noMatch = /(.)^/; 38 | 39 | // Certain characters need to be escaped so that they can be put into a 40 | // string literal. 41 | var escapes = { 42 | "'": "'", 43 | '\\': '\\', 44 | '\r': 'r', 45 | '\n': 'n', 46 | '\t': 't', 47 | '\u2028': 'u2028', 48 | '\u2029': 'u2029' 49 | }; 50 | 51 | var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; 52 | 53 | // JavaScript micro-templating, similar to John Resig's implementation. 54 | // Underscore templating handles arbitrary delimiters, preserves whitespace, 55 | // and correctly escapes quotes within interpolated code. 56 | _.template = function(text, data, settings) { 57 | var render; 58 | settings = _.defaults({}, settings, _.templateSettings); 59 | 60 | // Combine delimiters into one regular expression via alternation. 61 | var matcher = new RegExp([ 62 | (settings.escape || noMatch).source, 63 | (settings.interpolate || noMatch).source, 64 | (settings.evaluate || noMatch).source 65 | ].join('|') + '|$', 'g'); 66 | 67 | // Compile the template source, escaping string literals appropriately. 68 | var index = 0; 69 | var source = "__p+='"; 70 | text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { 71 | source += text.slice(index, offset) 72 | .replace(escaper, function(match) { return '\\' + escapes[match]; }); 73 | 74 | if (escape) { 75 | source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; 76 | } 77 | if (interpolate) { 78 | source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; 79 | } 80 | if (evaluate) { 81 | source += "';\n" + evaluate + "\n__p+='"; 82 | } 83 | index = offset + match.length; 84 | return match; 85 | }); 86 | source += "';\n"; 87 | 88 | // If a variable is not specified, place data values in local scope. 89 | if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; 90 | 91 | source = "var __t,__p='',__j=Array.prototype.join," + 92 | "print=function(){__p+=__j.call(arguments,'');};\n" + 93 | source + "return __p;\n"; 94 | 95 | try { 96 | render = new Function(settings.variable || 'obj', '_', source); 97 | } catch (e) { 98 | e.source = source; 99 | throw e; 100 | } 101 | 102 | if (data) return render(data, _); 103 | var template = function(data) { 104 | return render.call(this, data, _); 105 | }; 106 | 107 | // Provide the compiled function source as a convenience for precompilation. 108 | template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; 109 | 110 | return template; 111 | }; 112 | 113 | return _; 114 | })({}); 115 | 116 | if (location.hostname === 'todomvc.com') { 117 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 118 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 119 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 120 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 121 | ga('create', 'UA-31081062-1', 'auto'); 122 | ga('send', 'pageview'); 123 | } 124 | /* jshint ignore:end */ 125 | 126 | function redirect() { 127 | if (location.hostname === 'tastejs.github.io') { 128 | location.href = location.href.replace('tastejs.github.io/todomvc', 'todomvc.com'); 129 | } 130 | } 131 | 132 | function findRoot() { 133 | var base = location.href.indexOf('examples/'); 134 | return location.href.substr(0, base); 135 | } 136 | 137 | function getFile(file, callback) { 138 | if (!location.host) { 139 | return console.info('Miss the info bar? Run TodoMVC from a server to avoid a cross-origin error.'); 140 | } 141 | 142 | var xhr = new XMLHttpRequest(); 143 | 144 | xhr.open('GET', findRoot() + file, true); 145 | xhr.send(); 146 | 147 | xhr.onload = function () { 148 | if (xhr.status === 200 && callback) { 149 | callback(xhr.responseText); 150 | } 151 | }; 152 | } 153 | 154 | function Learn(learnJSON, config) { 155 | if (!(this instanceof Learn)) { 156 | return new Learn(learnJSON, config); 157 | } 158 | 159 | var template, framework; 160 | 161 | if (typeof learnJSON !== 'object') { 162 | try { 163 | learnJSON = JSON.parse(learnJSON); 164 | } catch (e) { 165 | return; 166 | } 167 | } 168 | 169 | if (config) { 170 | template = config.template; 171 | framework = config.framework; 172 | } 173 | 174 | if (!template && learnJSON.templates) { 175 | template = learnJSON.templates.todomvc; 176 | } 177 | 178 | if (!framework && document.querySelector('[data-framework]')) { 179 | framework = document.querySelector('[data-framework]').dataset.framework; 180 | } 181 | 182 | this.template = template; 183 | 184 | if (learnJSON.backend) { 185 | this.frameworkJSON = learnJSON.backend; 186 | this.frameworkJSON.issueLabel = framework; 187 | this.append({ 188 | backend: true 189 | }); 190 | } else if (learnJSON[framework]) { 191 | this.frameworkJSON = learnJSON[framework]; 192 | this.frameworkJSON.issueLabel = framework; 193 | this.append(); 194 | } 195 | 196 | this.fetchIssueCount(); 197 | } 198 | 199 | Learn.prototype.append = function (opts) { 200 | var aside = document.createElement('aside'); 201 | aside.innerHTML = _.template(this.template, this.frameworkJSON); 202 | aside.className = 'learn'; 203 | 204 | if (opts && opts.backend) { 205 | // Remove demo link 206 | var sourceLinks = aside.querySelector('.source-links'); 207 | var heading = sourceLinks.firstElementChild; 208 | var sourceLink = sourceLinks.lastElementChild; 209 | // Correct link path 210 | var href = sourceLink.getAttribute('href'); 211 | sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http'))); 212 | sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML; 213 | } else { 214 | // Localize demo links 215 | var demoLinks = aside.querySelectorAll('.demo-link'); 216 | Array.prototype.forEach.call(demoLinks, function (demoLink) { 217 | if (demoLink.getAttribute('href').substr(0, 4) !== 'http') { 218 | demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href')); 219 | } 220 | }); 221 | } 222 | 223 | document.body.className = (document.body.className + ' learn-bar').trim(); 224 | document.body.insertAdjacentHTML('afterBegin', aside.outerHTML); 225 | }; 226 | 227 | Learn.prototype.fetchIssueCount = function () { 228 | var issueLink = document.getElementById('issue-count-link'); 229 | if (issueLink) { 230 | var url = issueLink.href.replace('https://github.com', 'https://api.github.com/repos'); 231 | var xhr = new XMLHttpRequest(); 232 | xhr.open('GET', url, true); 233 | xhr.onload = function (e) { 234 | var parsedResponse = JSON.parse(e.target.responseText); 235 | if (parsedResponse instanceof Array) { 236 | var count = parsedResponse.length; 237 | if (count !== 0) { 238 | issueLink.innerHTML = 'This app has ' + count + ' open issues'; 239 | document.getElementById('issue-count').style.display = 'inline'; 240 | } 241 | } 242 | }; 243 | xhr.send(); 244 | } 245 | }; 246 | 247 | redirect(); 248 | getFile('learn.json', Learn); 249 | })(); 250 | -------------------------------------------------------------------------------- /dist/bundle.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";const e=Symbol("solid-proxy"),t=Symbol("solid-track"),n={equals:(e,t)=>e===t};let o=C;const r=1,l=2,s={owned:null,cleanups:null,context:null,owner:null};var i=null;let c=null,u=null,a=null,f=0;function d(e,t){const n=c,o=i,r=0===e.length,l=r?s:{owned:null,cleanups:null,context:null,owner:void 0===t?o:t},u=r?e:()=>e((()=>y((()=>j(l)))));i=l,c=null;try{return k(u,!0)}finally{c=n,i=o}}function h(e,t){const o={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},n,t):n).equals||void 0};return[w.bind(o),e=>("function"==typeof e&&(e=e(o.value)),m(o,e))]}function p(e,t,n){$(A(e,t,!1,r))}function g(e,t,o){o=o?Object.assign({},n,o):n;const r=A(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=o.equals||void 0,$(r),w.bind(r)}function y(e){if(null===c)return e();const t=c;c=null;try{return e()}finally{c=t}}function b(e){return null===i||(null===i.cleanups?i.cleanups=[e]:i.cleanups.push(e)),e}function v(){return c}function w(){if(this.sources&&this.state)if(this.state===r)$(this);else{const e=u;u=null,k((()=>x(this)),!1),u=e}if(c){const e=this.observers?this.observers.length:0;c.sources?(c.sources.push(this),c.sourceSlots.push(e)):(c.sources=[this],c.sourceSlots=[e]),this.observers?(this.observers.push(c),this.observerSlots.push(c.sources.length-1)):(this.observers=[c],this.observerSlots=[c.sources.length-1])}return this.value}function m(e,t,n){let o=e.value;return e.comparator&&e.comparator(o,t)||(e.value=t,e.observers&&e.observers.length&&k((()=>{for(let t=0;t1e6)throw u=[],new Error}),!1)),t}function $(e){if(!e.fn)return;j(e);const t=i,n=c,o=f;c=i=e,function(e,t,n){let o;try{o=e.fn(t)}catch(t){return e.pure&&(e.state=r,e.owned&&e.owned.forEach(j),e.owned=null),e.updatedAt=n+1,P(t)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?m(e,o):e.value=o,e.updatedAt=n)}(e,e.value,o),c=n,i=t}function A(e,t,n,o=r,l){const c={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:i,context:null,pure:n};return null===i||i!==s&&(i.owned?i.owned.push(c):i.owned=[c]),c}function S(e){if(0===e.state)return;if(e.state===l)return x(e);if(e.suspense&&y(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if((e=t[n]).state===r)$(e);else if(e.state===l){const n=u;u=null,k((()=>x(e,t[0])),!1),u=n}}function k(e,t){if(u)return e();let n=!1;t||(u=[]),a?n=!0:a=[],f++;try{const t=e();return function(e){u&&(C(u),u=null);if(e)return;const t=a;a=null,t.length&&k((()=>o(t)),!1)}(n),t}catch(e){n||(a=null),u=null,P(e)}}function C(e){for(let t=0;t=0;t--)j(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function P(e){throw e}const T=Symbol("fallback");function D(e){for(let t=0;te(t||{})))}const M=e=>`Stale read from <${e}>.`;function E(e){const n="fallback"in e&&{fallback:()=>e.fallback};return g(function(e,n,o={}){let r=[],l=[],s=[],i=0,c=n.length>1?[]:null;return b((()=>D(s))),()=>{let u,a,f=e()||[];return f[t],y((()=>{let e,t,n,h,g,y,b,v,w,m=f.length;if(0===m)0!==i&&(D(s),s=[],r=[],l=[],i=0,c&&(c=[])),o.fallback&&(r=[T],l[0]=d((e=>(s[0]=e,o.fallback()))),i=1);else if(0===i){for(l=new Array(m),a=0;a=y&&v>=y&&r[b]===f[v];b--,v--)n[v]=l[b],h[v]=s[b],c&&(g[v]=c[b]);for(e=new Map,t=new Array(v+1),a=v;a>=y;a--)w=f[a],u=e.get(w),t[a]=void 0===u?-1:u,e.set(w,a);for(u=y;u<=b;u++)w=r[u],a=e.get(w),void 0!==a&&-1!==a?(n[a]=l[u],h[a]=s[u],c&&(g[a]=c[u]),a=t[a],e.set(w,a)):s[u]();for(a=y;ae.each),e.children,n||void 0))}function L(e){const t=e.keyed,n=g((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return g((()=>{const o=n();if(o){const r=e.children;return"function"==typeof r&&r.length>0?y((()=>r(t?o:()=>{if(!y(n))throw M("Show");return e.when}))):r}return e.fallback}),void 0,void 0)}const B="_$DX_DELEGATE";function I(e,t,n){let o;const r=()=>{const t=document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:t.content.firstChild},l=t?()=>(o||(o=r())).cloneNode(!0):()=>y((()=>document.importNode(o||(o=r()),!0)));return l.cloneNode=l,l}function q(e,t,n,o){if(void 0===n||o||(o=[]),"function"!=typeof t)return F(e,t,o,n);p((o=>F(e,t(),o,n)),o)}function z(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document});n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(void 0!==r?o.call(n,r,e):o.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function F(e,t,n,o,r){for(;"function"==typeof n;)n=n();if(t===n)return n;const l=typeof t,s=void 0!==o;if(e=s&&n[0]&&n[0].parentNode||e,"string"===l||"number"===l)if("number"===l&&(t=t.toString()),s){let r=n[0];r&&3===r.nodeType?r.data=t:r=document.createTextNode(t),n=R(e,n,o,r)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===l)n=R(e,n,o);else{if("function"===l)return p((()=>{let r=t();for(;"function"==typeof r;)r=r();n=F(e,r,n,o)})),()=>n;if(Array.isArray(t)){const l=[],i=n&&Array.isArray(n);if(J(l,t,n,r))return p((()=>n=F(e,l,n,o,!0))),()=>n;if(0===l.length){if(n=R(e,n,o),s)return n}else i?0===n.length?K(e,l,o):function(e,t,n){let o=n.length,r=t.length,l=o,s=0,i=0,c=t[r-1].nextSibling,u=null;for(;so-i){const r=t[s];for(;i=0;l--){const s=t[l];if(r!==s){const t=s.parentNode===e;o||l?t&&s.remove():t?e.replaceChild(r,s):e.insertBefore(r,n)}else o=!0}}else e.insertBefore(r,n);return[r]}const G=Symbol("store-raw"),H=Symbol("store-node");function U(t){let n=t[e];if(!n&&(Object.defineProperty(t,e,{value:n=new Proxy(t,ee)}),!Array.isArray(t))){const e=Object.keys(t),o=Object.getOwnPropertyDescriptors(t);for(let r=0,l=e.length;r!0,deleteProperty:()=>!0,ownKeys:function(e){return Y(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(t,n){const o=Reflect.getOwnPropertyDescriptor(t,n);return o&&!o.get&&o.configurable&&n!==e&&n!==H?(delete o.value,delete o.writable,o.get=()=>t[e][n],o):o}};function te(e,t,n,o=!1){if(!o&&e[t]===n)return;const r=e[t],l=e.length;void 0===n?delete e[t]:e[t]=n;let s,i=Q(e);(s=V(i,t,r))&&s.$((()=>n)),Array.isArray(e)&&e.length!==l&&(s=V(i,"length",l))&&s.$(e.length),(s=i._)&&s.$()}function ne(e,t){const n=Object.keys(t);for(let o=0;o1){o=t.shift();const l=typeof o,s=Array.isArray(e);if(Array.isArray(o)){for(let r=0;r1)return void oe(e[o],t,[o].concat(n));r=e[o],n=[o].concat(n)}let l=t[0];"function"==typeof l&&(l=l(r,n),l===r)||void 0===o&&null==l||(l=X(l),void 0===o||W(r)&&W(l)&&!Array.isArray(l)?ne(r,l):te(e,o,l))}function re(...[e,t]){const n=X(e||{}),o=Array.isArray(n);return[U(n),function(...e){k((()=>{o&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=X(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n
    '),se=I('
134 | 135 | 136 | 152 | 153 | 154 | ); 155 | }; 156 | 157 | render(TodoApp, document.getElementById("main")!); 158 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "esModuleInterop": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "jsxImportSource": "solid-js", 9 | "jsx": "preserve", 10 | "strict": true 11 | } 12 | } --------------------------------------------------------------------------------