jaxs 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/jaxs.d.ts +634 -0
  2. package/dist/jaxs.js +793 -1054
  3. package/dist/jaxs.umd.cjs +1 -0
  4. package/package.json +41 -30
  5. package/.env +0 -1
  6. package/README.md +0 -15
  7. package/bun.lockb +0 -0
  8. package/bundle.ts +0 -5
  9. package/bunfig.toml +0 -0
  10. package/cypress/e2e/add-remove-nested-children.cy.js +0 -39
  11. package/cypress/e2e/add-remove-root-children.cy.js +0 -37
  12. package/cypress/e2e/svg-renders.cy.js +0 -10
  13. package/cypress/jaxs-apps/add-remove-nested-children.html +0 -12
  14. package/cypress/jaxs-apps/add-remove-nested-children.jsx +0 -85
  15. package/cypress/jaxs-apps/add-remove-root-children.html +0 -15
  16. package/cypress/jaxs-apps/add-remove-root-children.jsx +0 -54
  17. package/cypress/jaxs-apps/dist/add-remove-nested-children.afcab974.js +0 -1022
  18. package/cypress/jaxs-apps/dist/add-remove-nested-children.afcab974.js.map +0 -1
  19. package/cypress/jaxs-apps/dist/add-remove-nested-children.html +0 -12
  20. package/cypress/jaxs-apps/dist/add-remove-root-children.3bb9b3f5.js +0 -1665
  21. package/cypress/jaxs-apps/dist/add-remove-root-children.3bb9b3f5.js.map +0 -1
  22. package/cypress/jaxs-apps/dist/add-remove-root-children.fbb4ec9b.js +0 -1011
  23. package/cypress/jaxs-apps/dist/add-remove-root-children.fbb4ec9b.js.map +0 -1
  24. package/cypress/jaxs-apps/dist/add-remove-root-children.html +0 -15
  25. package/cypress/jaxs-apps/dist/svg.04290504.js +0 -644
  26. package/cypress/jaxs-apps/dist/svg.04290504.js.map +0 -1
  27. package/cypress/jaxs-apps/dist/svg.html +0 -11
  28. package/cypress/jaxs-apps/svg.html +0 -11
  29. package/cypress/jaxs-apps/svg.jsx +0 -15
  30. package/cypress/support/commands.js +0 -25
  31. package/cypress/support/e2e.js +0 -20
  32. package/cypress.config.js +0 -10
  33. package/src/app.ts +0 -64
  34. package/src/debugging.js +0 -5
  35. package/src/jaxs.ts +0 -7
  36. package/src/jsx.js +0 -27
  37. package/src/messageBus.ts +0 -70
  38. package/src/navigation/findHref.js +0 -10
  39. package/src/navigation/routeState.js +0 -15
  40. package/src/navigation/setupHistory.js +0 -38
  41. package/src/navigation/setupNavigation.js +0 -25
  42. package/src/navigation.ts +0 -2
  43. package/src/rendering/change/compile.ts +0 -1
  44. package/src/rendering/change/instructions/attributes.ts +0 -81
  45. package/src/rendering/change/instructions/children.ts +0 -127
  46. package/src/rendering/change/instructions/element.ts +0 -49
  47. package/src/rendering/change/instructions/events.ts +0 -51
  48. package/src/rendering/change/instructions/generate.ts +0 -122
  49. package/src/rendering/change/instructions/idMap.js +0 -55
  50. package/src/rendering/change/instructions/node.ts +0 -55
  51. package/src/rendering/change/instructions/text.ts +0 -10
  52. package/src/rendering/change.ts +0 -139
  53. package/src/rendering/dom/attributesAndEvents.ts +0 -33
  54. package/src/rendering/dom/create.ts +0 -68
  55. package/src/rendering/dom/svg.ts +0 -18
  56. package/src/rendering/templates/bound.js +0 -56
  57. package/src/rendering/templates/children.ts +0 -99
  58. package/src/rendering/templates/root.ts +0 -55
  59. package/src/rendering/templates/tag.ts +0 -92
  60. package/src/rendering/templates/text.ts +0 -17
  61. package/src/state/equality.js +0 -36
  62. package/src/state/stores.js +0 -63
  63. package/src/state/testingTypes.js +0 -6
  64. package/src/state.js +0 -89
  65. package/src/types.ts +0 -152
  66. package/src/views/conditionals.jsx +0 -18
  67. package/src/views/link.jsx +0 -5
  68. package/src/views.js +0 -7
  69. package/tsconfig.json +0 -26
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ORT = null;var HMR_SECURE = false;var HMR_ENV_HASH = \"d6ea1d42532a7575\";module.bundle.HMR_BUNDLE_ID = \"318855cf04290504\";\"use strict\";\n\n/* global HMR_HOST, HMR_PORT, HMR_ENV_HASH, HMR_SECURE, chrome, browser, __parcel__import__, __parcel__importScripts__, ServiceWorkerGlobalScope */\n/*::\nimport type {\n HMRAsset,\n HMRMessage,\n} from '@parcel/reporter-dev-server/src/HMRServer.js';\ninterface ParcelRequire {\n (string): mixed;\n cache: {|[string]: ParcelModule|};\n hotData: {|[string]: mixed|};\n Module: any;\n parent: ?ParcelRequire;\n isParcelRequire: true;\n modules: {|[string]: [Function, {|[string]: string|}]|};\n HMR_BUNDLE_ID: string;\n root: ParcelRequire;\n}\ninterface ParcelModule {\n hot: {|\n data: mixed,\n accept(cb: (Function) => void): void,\n dispose(cb: (mixed) => void): void,\n // accept(deps: Array<string> | string, cb: (Function) => void): void,\n // decline(): void,\n _acceptCallbacks: Array<(Function) => void>,\n _disposeCallbacks: Array<(mixed) => void>,\n |};\n}\ninterface ExtensionContext {\n runtime: {|\n reload(): void,\n getURL(url: string): string;\n getManifest(): {manifest_version: number, ...};\n |};\n}\ndeclare var module: {bundle: ParcelRequire, ...};\ndeclare var HMR_HOST: string;\ndeclare var HMR_PORT: string;\ndeclare var HMR_ENV_HASH: string;\ndeclare var HMR_SECURE: boolean;\ndeclare var chrome: ExtensionContext;\ndeclare var browser: ExtensionContext;\ndeclare var __parcel__import__: (string) => Promise<void>;\ndeclare var __parcel__importScripts__: (string) => Promise<void>;\ndeclare var globalThis: typeof self;\ndeclare var ServiceWorkerGlobalScope: Object;\n*/\nvar OVERLAY_ID = '__parcel__error__overlay__';\nvar OldModule = module.bundle.Module;\nfunction Module(moduleName) {\n OldModule.call(this, moduleName);\n this.hot = {\n data: module.bundle.hotData[moduleName],\n _acceptCallbacks: [],\n _disposeCallbacks: [],\n accept: function (fn) {\n this._acceptCallbacks.push(fn || function () {});\n },\n dispose: function (fn) {\n this._disposeCallbacks.push(fn);\n }\n };\n module.bundle.hotData[moduleName] = undefined;\n}\nmodule.bundle.Module = Module;\nmodule.bundle.hotData = {};\nvar checkedAssets /*: {|[string]: boolean|} */, assetsToDispose /*: Array<[ParcelRequire, string]> */, assetsToAccept /*: Array<[ParcelRequire, string]> */;\n\nfunction getHostname() {\n return HMR_HOST || (location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost');\n}\nfunction getPort() {\n return HMR_PORT || location.port;\n}\n\n// eslint-disable-next-line no-redeclare\nvar parent = module.bundle.parent;\nif ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {\n var hostname = getHostname();\n var port = getPort();\n var protocol = HMR_SECURE || location.protocol == 'https:' && !['localhost', '127.0.0.1', '0.0.0.0'].includes(hostname) ? 'wss' : 'ws';\n var ws;\n try {\n ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/');\n } catch (err) {\n if (err.message) {\n console.error(err.message);\n }\n ws = {};\n }\n\n // Web extension context\n var extCtx = typeof browser === 'undefined' ? typeof chrome === 'undefined' ? null : chrome : browser;\n\n // Safari doesn't support sourceURL in error stacks.\n // eval may also be disabled via CSP, so do a quick check.\n var supportsSourceURL = false;\n try {\n (0, eval)('throw new Error(\"test\"); //# sourceURL=test.js');\n } catch (err) {\n supportsSourceURL = err.stack.includes('test.js');\n }\n\n // $FlowFixMe\n ws.onmessage = async function (event /*: {data: string, ...} */) {\n checkedAssets = {} /*: {|[string]: boolean|} */;\n assetsToAccept = [];\n assetsToDispose = [];\n var data /*: HMRMessage */ = JSON.parse(event.data);\n if (data.type === 'update') {\n // Remove error overlay if there is one\n if (typeof document !== 'undefined') {\n removeErrorOverlay();\n }\n let assets = data.assets.filter(asset => asset.envHash === HMR_ENV_HASH);\n\n // Handle HMR Update\n let handled = assets.every(asset => {\n return asset.type === 'css' || asset.type === 'js' && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle);\n });\n if (handled) {\n console.clear();\n\n // Dispatch custom event so other runtimes (e.g React Refresh) are aware.\n if (typeof window !== 'undefined' && typeof CustomEvent !== 'undefined') {\n window.dispatchEvent(new CustomEvent('parcelhmraccept'));\n }\n await hmrApplyUpdates(assets);\n\n // Dispose all old assets.\n let processedAssets = {} /*: {|[string]: boolean|} */;\n for (let i = 0; i < assetsToDispose.length; i++) {\n let id = assetsToDispose[i][1];\n if (!processedAssets[id]) {\n hmrDispose(assetsToDispose[i][0], id);\n processedAssets[id] = true;\n }\n }\n\n // Run accept callbacks. This will also re-execute other disposed assets in topological order.\n processedAssets = {};\n for (let i = 0; i < assetsToAccept.length; i++) {\n let id = assetsToAccept[i][1];\n if (!processedAssets[id]) {\n hmrAccept(assetsToAccept[i][0], id);\n processedAssets[id] = true;\n }\n }\n } else fullReload();\n }\n if (data.type === 'error') {\n // Log parcel errors to console\n for (let ansiDiagnostic of data.diagnostics.ansi) {\n let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack;\n console.error('🚨 [parcel]: ' + ansiDiagnostic.message + '\\n' + stack + '\\n\\n' + ansiDiagnostic.hints.join('\\n'));\n }\n if (typeof document !== 'undefined') {\n // Render the fancy html overlay\n removeErrorOverlay();\n var overlay = createErrorOverlay(data.diagnostics.html);\n // $FlowFixMe\n document.body.appendChild(overlay);\n }\n }\n };\n ws.onerror = function (e) {\n if (e.message) {\n console.error(e.message);\n }\n };\n ws.onclose = function () {\n console.warn('[parcel] 🚨 Connection to the HMR server was lost');\n };\n}\nfunction removeErrorOverlay() {\n var overlay = document.getElementById(OVERLAY_ID);\n if (overlay) {\n overlay.remove();\n console.log('[parcel] ✨ Error resolved');\n }\n}\nfunction createErrorOverlay(diagnostics) {\n var overlay = document.createElement('div');\n overlay.id = OVERLAY_ID;\n let errorHTML = '<div style=\"background: black; opacity: 0.85; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; font-family: Menlo, Consolas, monospace; z-index: 9999;\">';\n for (let diagnostic of diagnostics) {\n let stack = diagnostic.frames.length ? diagnostic.frames.reduce((p, frame) => {\n return `${p}\n<a href=\"/__parcel_launch_editor?file=${encodeURIComponent(frame.location)}\" style=\"text-decoration: underline; color: #888\" onclick=\"fetch(this.href); return false\">${frame.location}</a>\n${frame.code}`;\n }, '') : diagnostic.stack;\n errorHTML += `\n <div>\n <div style=\"font-size: 18px; font-weight: bold; margin-top: 20px;\">\n 🚨 ${diagnostic.message}\n </div>\n <pre>${stack}</pre>\n <div>\n ${diagnostic.hints.map(hint => '<div>💡 ' + hint + '</div>').join('')}\n </div>\n ${diagnostic.documentation ? `<div>📝 <a style=\"color: violet\" href=\"${diagnostic.documentation}\" target=\"_blank\">Learn more</a></div>` : ''}\n </div>\n `;\n }\n errorHTML += '</div>';\n overlay.innerHTML = errorHTML;\n return overlay;\n}\nfunction fullReload() {\n if ('reload' in location) {\n location.reload();\n } else if (extCtx && extCtx.runtime && extCtx.runtime.reload) {\n extCtx.runtime.reload();\n }\n}\nfunction getParents(bundle, id) /*: Array<[ParcelRequire, string]> */{\n var modules = bundle.modules;\n if (!modules) {\n return [];\n }\n var parents = [];\n var k, d, dep;\n for (k in modules) {\n for (d in modules[k][1]) {\n dep = modules[k][1][d];\n if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {\n parents.push([bundle, k]);\n }\n }\n }\n if (bundle.parent) {\n parents = parents.concat(getParents(bundle.parent, id));\n }\n return parents;\n}\nfunction updateLink(link) {\n var href = link.getAttribute('href');\n if (!href) {\n return;\n }\n var newLink = link.cloneNode();\n newLink.onload = function () {\n if (link.parentNode !== null) {\n // $FlowFixMe\n link.parentNode.removeChild(link);\n }\n };\n newLink.setAttribute('href',\n // $FlowFixMe\n href.split('?')[0] + '?' + Date.now());\n // $FlowFixMe\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\nvar cssTimeout = null;\nfunction reloadCSS() {\n if (cssTimeout) {\n return;\n }\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n // $FlowFixMe[incompatible-type]\n var href /*: string */ = links[i].getAttribute('href');\n var hostname = getHostname();\n var servedFromHMRServer = hostname === 'localhost' ? new RegExp('^(https?:\\\\/\\\\/(0.0.0.0|127.0.0.1)|localhost):' + getPort()).test(href) : href.indexOf(hostname + ':' + getPort());\n var absolute = /^https?:\\/\\//i.test(href) && href.indexOf(location.origin) !== 0 && !servedFromHMRServer;\n if (!absolute) {\n updateLink(links[i]);\n }\n }\n cssTimeout = null;\n }, 50);\n}\nfunction hmrDownload(asset) {\n if (asset.type === 'js') {\n if (typeof document !== 'undefined') {\n let script = document.createElement('script');\n script.src = asset.url + '?t=' + Date.now();\n if (asset.outputFormat === 'esmodule') {\n script.type = 'module';\n }\n return new Promise((resolve, reject) => {\n var _document$head;\n script.onload = () => resolve(script);\n script.onerror = reject;\n (_document$head = document.head) === null || _document$head === void 0 || _document$head.appendChild(script);\n });\n } else if (typeof importScripts === 'function') {\n // Worker scripts\n if (asset.outputFormat === 'esmodule') {\n return __parcel__import__(asset.url + '?t=' + Date.now());\n } else {\n return new Promise((resolve, reject) => {\n try {\n __parcel__importScripts__(asset.url + '?t=' + Date.now());\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n }\n }\n}\nasync function hmrApplyUpdates(assets) {\n global.parcelHotUpdate = Object.create(null);\n let scriptsToRemove;\n try {\n // If sourceURL comments aren't supported in eval, we need to load\n // the update from the dev server over HTTP so that stack traces\n // are correct in errors/logs. This is much slower than eval, so\n // we only do it if needed (currently just Safari).\n // https://bugs.webkit.org/show_bug.cgi?id=137297\n // This path is also taken if a CSP disallows eval.\n if (!supportsSourceURL) {\n let promises = assets.map(asset => {\n var _hmrDownload;\n return (_hmrDownload = hmrDownload(asset)) === null || _hmrDownload === void 0 ? void 0 : _hmrDownload.catch(err => {\n // Web extension fix\n if (extCtx && extCtx.runtime && extCtx.runtime.getManifest().manifest_version == 3 && typeof ServiceWorkerGlobalScope != 'undefined' && global instanceof ServiceWorkerGlobalScope) {\n extCtx.runtime.reload();\n return;\n }\n throw err;\n });\n });\n scriptsToRemove = await Promise.all(promises);\n }\n assets.forEach(function (asset) {\n hmrApply(module.bundle.root, asset);\n });\n } finally {\n delete global.parcelHotUpdate;\n if (scriptsToRemove) {\n scriptsToRemove.forEach(script => {\n if (script) {\n var _document$head2;\n (_document$head2 = document.head) === null || _document$head2 === void 0 || _document$head2.removeChild(script);\n }\n });\n }\n }\n}\nfunction hmrApply(bundle /*: ParcelRequire */, asset /*: HMRAsset */) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (asset.type === 'css') {\n reloadCSS();\n } else if (asset.type === 'js') {\n let deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID];\n if (deps) {\n if (modules[asset.id]) {\n // Remove dependencies that are removed and will become orphaned.\n // This is necessary so that if the asset is added back again, the cache is gone, and we prevent a full page reload.\n let oldDeps = modules[asset.id][1];\n for (let dep in oldDeps) {\n if (!deps[dep] || deps[dep] !== oldDeps[dep]) {\n let id = oldDeps[dep];\n let parents = getParents(module.bundle.root, id);\n if (parents.length === 1) {\n hmrDelete(module.bundle.root, id);\n }\n }\n }\n }\n if (supportsSourceURL) {\n // Global eval. We would use `new Function` here but browser\n // support for source maps is better with eval.\n (0, eval)(asset.output);\n }\n\n // $FlowFixMe\n let fn = global.parcelHotUpdate[asset.id];\n modules[asset.id] = [fn, deps];\n } else if (bundle.parent) {\n hmrApply(bundle.parent, asset);\n }\n }\n}\nfunction hmrDelete(bundle, id) {\n let modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (modules[id]) {\n // Collect dependencies that will become orphaned when this module is deleted.\n let deps = modules[id][1];\n let orphans = [];\n for (let dep in deps) {\n let parents = getParents(module.bundle.root, deps[dep]);\n if (parents.length === 1) {\n orphans.push(deps[dep]);\n }\n }\n\n // Delete the module. This must be done before deleting dependencies in case of circular dependencies.\n delete modules[id];\n delete bundle.cache[id];\n\n // Now delete the orphans.\n orphans.forEach(id => {\n hmrDelete(module.bundle.root, id);\n });\n } else if (bundle.parent) {\n hmrDelete(bundle.parent, id);\n }\n}\nfunction hmrAcceptCheck(bundle /*: ParcelRequire */, id /*: string */, depsByBundle /*: ?{ [string]: { [string]: string } }*/) {\n if (hmrAcceptCheckOne(bundle, id, depsByBundle)) {\n return true;\n }\n\n // Traverse parents breadth first. All possible ancestries must accept the HMR update, or we'll reload.\n let parents = getParents(module.bundle.root, id);\n let accepted = false;\n while (parents.length > 0) {\n let v = parents.shift();\n let a = hmrAcceptCheckOne(v[0], v[1], null);\n if (a) {\n // If this parent accepts, stop traversing upward, but still consider siblings.\n accepted = true;\n } else {\n // Otherwise, queue the parents in the next level upward.\n let p = getParents(module.bundle.root, v[1]);\n if (p.length === 0) {\n // If there are no parents, then we've reached an entry without accepting. Reload.\n accepted = false;\n break;\n }\n parents.push(...p);\n }\n }\n return accepted;\n}\nfunction hmrAcceptCheckOne(bundle /*: ParcelRequire */, id /*: string */, depsByBundle /*: ?{ [string]: { [string]: string } }*/) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (depsByBundle && !depsByBundle[bundle.HMR_BUNDLE_ID]) {\n // If we reached the root bundle without finding where the asset should go,\n // there's nothing to do. Mark as \"accepted\" so we don't reload the page.\n if (!bundle.parent) {\n return true;\n }\n return hmrAcceptCheck(bundle.parent, id, depsByBundle);\n }\n if (checkedAssets[id]) {\n return true;\n }\n checkedAssets[id] = true;\n var cached = bundle.cache[id];\n assetsToDispose.push([bundle, id]);\n if (!cached || cached.hot && cached.hot._acceptCallbacks.length) {\n assetsToAccept.push([bundle, id]);\n return true;\n }\n}\nfunction hmrDispose(bundle /*: ParcelRequire */, id /*: string */) {\n var cached = bundle.cache[id];\n bundle.hotData[id] = {};\n if (cached && cached.hot) {\n cached.hot.data = bundle.hotData[id];\n }\n if (cached && cached.hot && cached.hot._disposeCallbacks.length) {\n cached.hot._disposeCallbacks.forEach(function (cb) {\n cb(bundle.hotData[id]);\n });\n }\n delete bundle.cache[id];\n}\nfunction hmrAccept(bundle /*: ParcelRequire */, id /*: string */) {\n // Execute the module.\n bundle(id);\n\n // Run the accept callbacks in the new version of the module.\n var cached = bundle.cache[id];\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n cached.hot._acceptCallbacks.forEach(function (cb) {\n var assetsToAlsoAccept = cb(function () {\n return getParents(module.bundle.root, id);\n });\n if (assetsToAlsoAccept && assetsToAccept.length) {\n assetsToAlsoAccept.forEach(function (a) {\n hmrDispose(a[0], a[1]);\n });\n\n // $FlowFixMe[method-unbinding]\n assetsToAccept.push.apply(assetsToAccept, assetsToAlsoAccept);\n }\n });\n }\n}","import { createApp, jsx } from '../../dist/jaxs.js'\n\nconst app = createApp()\n\nexport const EyeIcon = () => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' class='icon icon-tabler icon-tabler-eye' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor' fill='none' stroke-linecap='round' stroke-linejoin='round'>\n <path stroke='none' d='M0 0h24v24H0z' fill='none' />\n <path d='M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0' />\n <path d='M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6' />\n </svg>\n )\n}\n\napp.render(<EyeIcon />, '#app')\n"],"names":[],"version":3,"file":"svg.04290504.js.map","sourceRoot":"/__parcel_source_root/"}
@@ -1,11 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Jaxs integration test</title>
6
- <script src="/add-remove-root-children.3bb9b3f5.js"></script><script src="/svg.04290504.js" defer=""></script>
7
- </head>
8
- <body>
9
- <main id="app"></main>
10
- </body>
11
- </html>
@@ -1,11 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8"/>
5
- <title>Jaxs integration test</title>
6
- <script type="module" src="./svg.jsx"></script>
7
- </head>
8
- <body>
9
- <main id="app"></main>
10
- </body>
11
- </html>
@@ -1,15 +0,0 @@
1
- import { createApp, jsx } from '../../dist/jaxs.js'
2
-
3
- const app = createApp()
4
-
5
- export const EyeIcon = () => {
6
- return (
7
- <svg xmlns='http://www.w3.org/2000/svg' class='icon icon-tabler icon-tabler-eye' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor' fill='none' stroke-linecap='round' stroke-linejoin='round'>
8
- <path stroke='none' d='M0 0h24v24H0z' fill='none' />
9
- <path d='M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0' />
10
- <path d='M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6' />
11
- </svg>
12
- )
13
- }
14
-
15
- app.render(<EyeIcon />, '#app')
@@ -1,25 +0,0 @@
1
- // ***********************************************
2
- // This example commands.js shows you how to
3
- // create various custom commands and overwrite
4
- // existing commands.
5
- //
6
- // For more comprehensive examples of custom
7
- // commands please read more here:
8
- // https://on.cypress.io/custom-commands
9
- // ***********************************************
10
- //
11
- //
12
- // -- This is a parent command --
13
- // Cypress.Commands.add('login', (email, password) => { ... })
14
- //
15
- //
16
- // -- This is a child command --
17
- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18
- //
19
- //
20
- // -- This is a dual command --
21
- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22
- //
23
- //
24
- // -- This will overwrite an existing command --
25
- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
@@ -1,20 +0,0 @@
1
- // ***********************************************************
2
- // This example support/e2e.js is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
-
19
- // Alternatively you can use CommonJS syntax:
20
- // require('./commands')
package/cypress.config.js DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'cypress'
2
-
3
- export default defineConfig({
4
- e2e: {
5
- setupNodeEvents (on, config) {
6
- // implement node event listeners here
7
- },
8
- specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx,spec}'
9
- }
10
- })
package/src/app.ts DELETED
@@ -1,64 +0,0 @@
1
- import type { App, BusPublish, BusSubscribe } from './types';
2
- import { createBus } from './messageBus';
3
- import { State } from './state'
4
- import {
5
- locationChangeEvent,
6
- setupHistory,
7
- } from './navigation/setupHistory';
8
- import { setupNavigation } from './navigation/setupNavigation';
9
- import { render } from './rendering/templates/root';
10
-
11
- const setupBus = (app: App) => {
12
- const { publish, subscribe, bus } = createBus();
13
-
14
- app.publish = publish;
15
- app.subscribe = subscribe;
16
- app.bus = bus;
17
- };
18
-
19
- const setupState = (app: App) => {
20
- const state = new State(app.publish as BusPublish);
21
- app.state = state;
22
- };
23
-
24
- const connectBusToState = (app: App) => {
25
- const { bus } = app;
26
- bus.addListenerOptions({ state: app.state });
27
- };
28
-
29
- const setupRenderKit = (app: App, document: Document) => {
30
- app.renderKit = {
31
- publish: app.publish as BusPublish,
32
- subscribe: app.subscribe as BusSubscribe,
33
- state: app.state as State,
34
- document,
35
- };
36
- };
37
-
38
- const triggerRoute = (app: App) => {
39
- const publish = app.publish as BusPublish;
40
- setTimeout(() => {
41
- publish(locationChangeEvent, null);
42
- }, 0);
43
- };
44
-
45
- const addRender = (app: App) => {
46
- app.render = (template, selector) => {
47
- return render(template, selector, app.renderKit);
48
- };
49
- };
50
-
51
- export const createApp = (document = window.document) => {
52
- const app = {} as App;
53
-
54
- setupBus(app);
55
- setupState(app);
56
- connectBusToState(app);
57
- setupRenderKit(app, document);
58
- setupHistory(app);
59
- setupNavigation(app);
60
- triggerRoute(app);
61
- addRender(app);
62
-
63
- return app;
64
- };
package/src/debugging.js DELETED
@@ -1,5 +0,0 @@
1
- export const debug = (...message) => {
2
- // if (Bun.env.DEBUG === 'true') {
3
- console.log(...message)
4
- // }
5
- }
package/src/jaxs.ts DELETED
@@ -1,7 +0,0 @@
1
- export { default as jsx } from './jsx'
2
- export { render } from './rendering/templates/root'
3
- export { bind } from './rendering/templates/bound'
4
- export { createBus } from './messageBus'
5
- export { createApp } from './app'
6
- export { State } from './state'
7
- export * as navigation from './navigation'
package/src/jsx.js DELETED
@@ -1,27 +0,0 @@
1
- import { Tag } from './rendering/templates/tag'
2
- import { Children } from './rendering/templates/children'
3
-
4
- const ensureChildrenArray = (maybeChildren, attributes) =>
5
- maybeChildren || attributes.children || []
6
-
7
- const packageAttributes = (maybeAttributes, maybeChildren) => {
8
- const attributes = maybeAttributes || {}
9
- const children = ensureChildrenArray(maybeChildren, attributes)
10
- attributes.children = attributes.children || children
11
- return attributes
12
- }
13
-
14
- const jsx = (type, attributes, ...children) => {
15
- if (typeof type === 'string') {
16
- return new Tag(type, attributes, children)
17
- }
18
-
19
- return type(packageAttributes(attributes, children))
20
- }
21
-
22
- jsx.fragment = (attributes, maybeChildren) => {
23
- const children = ensureChildrenArray(maybeChildren, attributes)
24
- return new Children(children)
25
- }
26
-
27
- export default jsx
package/src/messageBus.ts DELETED
@@ -1,70 +0,0 @@
1
- import type {
2
- BusEventName,
3
- BusListener,
4
- BusListenersMap,
5
- BusOptions,
6
- BusPayload,
7
- } from './types';
8
-
9
- export class MessageBus {
10
- listeners: BusListenersMap;
11
- options: BusOptions;
12
-
13
- constructor() {
14
- this.options = {};
15
- this.listeners = {};
16
- }
17
-
18
- subscribe(eventName: BusEventName, listener: BusListener) {
19
- this.ensureListenerCollection(eventName);
20
-
21
- this.listeners[eventName].push(listener);
22
- }
23
-
24
- publish(eventName: BusEventName, payload: BusPayload) {
25
- const listeners = this.listeners[eventName];
26
- if (!listeners) return false;
27
-
28
- listeners.forEach((listener: BusListener) => {
29
- listener(
30
- payload,
31
- this.buildListenerKit(eventName),
32
- );
33
- });
34
-
35
- return true;
36
- }
37
-
38
- ensureListenerCollection(eventName: BusEventName) {
39
- if (this.listeners[eventName]) return;
40
-
41
- this.listeners[eventName] = [];
42
- }
43
-
44
- buildListenerKit(eventName: BusEventName) {
45
- return {
46
- eventName,
47
- publish: this.publish.bind(this),
48
- ...this.options,
49
- };
50
- }
51
-
52
- addListenerOptions(options: BusOptions) {
53
- this.options = {
54
- ...this.options,
55
- ...options,
56
- };
57
- }
58
- }
59
-
60
- export const createBus = () => {
61
- const bus = new MessageBus();
62
- const publish = bus.publish.bind(bus);
63
- const subscribe = bus.subscribe.bind(bus);
64
-
65
- return {
66
- bus,
67
- publish,
68
- subscribe,
69
- };
70
- };
@@ -1,10 +0,0 @@
1
- export const findHref = (node) => {
2
- if (!node || !node.getAttribute) return ''
3
-
4
- while (!node.getAttribute('href')) {
5
- node = node.parentNode
6
- if (!node || !node.getAttribute) return ''
7
- }
8
-
9
- return node.getAttribute('href')
10
- }
@@ -1,15 +0,0 @@
1
- import { RecordStore } from '../state/stores'
2
-
3
- export const createRouteState = (state) => {
4
- const store = new RecordStore({
5
- name: 'route',
6
- value: {
7
- host: '',
8
- path: '',
9
- query: ''
10
- },
11
- parent: state
12
- })
13
-
14
- state.add(store)
15
- }
@@ -1,38 +0,0 @@
1
- import { createRouteState } from './routeState'
2
- export const locationChangeEvent = 'locationChange'
3
- export const routeChangeEvent = 'routeChange'
4
-
5
- export const extractQueryParams = (queryString) => {
6
- return queryString
7
- .replace(/^\?/, '')
8
- .split('&')
9
- .reduce((aggregate, pairString) => {
10
- if (!pairString) return aggregate
11
-
12
- const pair = pairString.split('=')
13
- aggregate[pair[0]] = pair[1]
14
- return aggregate
15
- }, {})
16
- }
17
-
18
- export const onLocationChange = (_payload, { publish, state }) => {
19
- const { host, pathname, search } = window.location
20
- const path = pathname
21
- const query = extractQueryParams(search)
22
-
23
- state.route.update({
24
- host,
25
- path,
26
- query
27
- })
28
-
29
- // subscribe for fetching data and other things
30
- publish(routeChangeEvent, { host, path, query })
31
- }
32
-
33
- export const setupHistory = (app) => {
34
- const { publish, subscribe, state } = app
35
- createRouteState(state)
36
- window.addEventListener('popstate', () => publish(locationChangeEvent))
37
- subscribe(locationChangeEvent, onLocationChange)
38
- }
@@ -1,25 +0,0 @@
1
- import { findHref } from './findHref'
2
- import { locationChangeEvent } from './setupHistory'
3
-
4
- export const linkNavigationEvent = 'goToHref'
5
- export const programmaticNavigationEvent = 'navigate'
6
-
7
- export const navigate = (path, { publish }) => {
8
- window.history.pushState(null, '', path)
9
- publish(locationChangeEvent)
10
- }
11
-
12
- export const onLinkClick = (domEvent, { publish }) => {
13
- if (!domEvent || !domEvent.target) return
14
- domEvent.preventDefault()
15
-
16
- const href = findHref(domEvent.target)
17
- navigate(href, { publish })
18
- }
19
-
20
- export const setupNavigation = (app) => {
21
- const { subscribe } = app
22
-
23
- subscribe(linkNavigationEvent, onLinkClick)
24
- subscribe(programmaticNavigationEvent, navigate)
25
- }
package/src/navigation.ts DELETED
@@ -1,2 +0,0 @@
1
- export { setupHistory } from './navigation/setupHistory';
2
- export { setupNavigation } from './navigation/setupNavigation';
@@ -1 +0,0 @@
1
- export { compileChildren as compileChange } from './instructions/children';
@@ -1,81 +0,0 @@
1
- import type { ExpandedElement, Instructions } from '../../../types';
2
- import { addAttribute, removeAttribute, updateAttribute } from './generate';
3
-
4
- export const compileForAttributes = (
5
- source: ExpandedElement,
6
- target: ExpandedElement,
7
- isSvg = false,
8
- ) => {
9
- const instructions = [] as Instructions;
10
- const sourceAttributes = source.attributes;
11
- const sourceLength = sourceAttributes.length;
12
- const targetAttributes = target.attributes;
13
- const targetLength = targetAttributes.length;
14
-
15
- // NOTE: this implementation sucks, but JSDOM doesn't properly implement
16
- // .getNamedItem and the deno dom doesn't implement the .length attribute.
17
- // It's a total test cluster fuck. When there are integration-y tests that
18
- // I can use for rerender via the DOM, I will get rid of unit tests and
19
- // improve the implementation. Sucks all around.
20
- let index;
21
- let innerIndex;
22
- let matchingAttribute;
23
-
24
- // iterate through the source attributes to find removals and updates
25
- for (index = 0; index < sourceLength; index++) {
26
- matchingAttribute = null;
27
- const sourceAttribute = sourceAttributes.item(index);
28
- if (!sourceAttribute) continue;
29
-
30
- for (innerIndex = 0; innerIndex < targetLength; innerIndex++) {
31
- const targetAttribute = targetAttributes.item(innerIndex);
32
- if (!targetAttribute) continue;
33
- if (sourceAttribute.name == targetAttribute.name) {
34
- matchingAttribute = targetAttribute;
35
- break;
36
- }
37
- }
38
-
39
- if (!matchingAttribute) {
40
- instructions.push(
41
- removeAttribute(source, target, { name: sourceAttribute.name, isSvg, }),
42
- );
43
- } else if (sourceAttribute.value !== matchingAttribute.value) {
44
- instructions.push(
45
- updateAttribute(source, target, {
46
- name: sourceAttribute.name,
47
- value: matchingAttribute.value,
48
- isSvg,
49
- }),
50
- );
51
- }
52
- }
53
-
54
- // iterate through the target to find additions
55
- for (index = 0; index < targetLength; index++) {
56
- matchingAttribute = null;
57
- const targetAttribute = targetAttributes.item(index);
58
- if (!targetAttribute) continue;
59
-
60
- for (innerIndex = 0; innerIndex < sourceLength; innerIndex++) {
61
- const sourceAttribute = sourceAttributes.item(innerIndex);
62
- if (!sourceAttribute) continue;
63
- if (sourceAttribute.name == targetAttribute.name) {
64
- matchingAttribute = sourceAttribute;
65
- break;
66
- }
67
- }
68
-
69
- if (!matchingAttribute) {
70
- instructions.push(
71
- addAttribute(source, target, {
72
- name: targetAttribute.name,
73
- value: targetAttribute.value,
74
- isSvg,
75
- }),
76
- );
77
- }
78
- }
79
-
80
- return instructions;
81
- };
@@ -1,127 +0,0 @@
1
- import type {
2
- Dom,
3
- ExpandedElement,
4
- HtmlChildren,
5
- Instruction,
6
- Instructions,
7
- } from '../../../types';
8
- import { insertNode, removeNode, replaceNode } from './generate';
9
- import { createIdMap } from './idMap';
10
- import { compileForNodeGenerator } from './node';
11
-
12
- type DiffPair = {
13
- source: Dom;
14
- target: Dom;
15
- };
16
-
17
- export const compileChildren = (
18
- sourceList: HtmlChildren,
19
- targetList: HtmlChildren,
20
- parent: ExpandedElement,
21
- ) => {
22
- const baseInstructions = [] as Instructions;
23
- const length = largerLength(sourceList, targetList);
24
- const sourceMap = createIdMap(sourceList);
25
- const targetMap = createIdMap(targetList);
26
- const nodesPairsToDiff = [] as DiffPair[];
27
-
28
- let index = 0;
29
- for (; index < length; index++) {
30
- const source = sourceList[index] as ExpandedElement;
31
- const target = targetList[index] as ExpandedElement;
32
- // debug(
33
- // '\n',
34
- // 'loop index',
35
- // index,
36
- // source && source.__jsx,
37
- // target && target.__jsx,
38
- // );
39
-
40
- // This algorithm uses the target as the source of truth, iterating
41
- // through it first figuring out what to do. The length could be larger than
42
- // the target length, which means that there are unresolved sources to remove.
43
- // Part of the goal of this flow is to ensure that insertions happen in
44
- // accending order.
45
- if (target && targetMap.check(target)) {
46
- // debug('target', target.__jsx, 'index', index);
47
- const matchingSource = sourceMap.pullMatch(target);
48
- targetMap.clear(target); // mark target as resolved
49
-
50
- if (matchingSource.element) {
51
- // debug('matching source found for target');
52
- if (matchingSource.index !== index) {
53
- // move source to index
54
- // debug('moving source', matchingSource.element.__jsx, index);
55
- baseInstructions.push(
56
- insertNode(matchingSource.element, { parent, index }),
57
- );
58
- }
59
- // update element for attribute, event and child changes
60
- // debug('updating to match target',
61
- // matchingSource.element.__jsx,
62
- // matchingSource.element.classList,
63
- // target.__jsx,
64
- // target.classList
65
- // );
66
- nodesPairsToDiff.push({
67
- source: matchingSource.element,
68
- target,
69
- });
70
- } else if (source) {
71
- // debug('NO matching source for target but source in slot', source.__jsx);
72
-
73
- if (targetMap.check(source)) {
74
- // the source is somewhere else in the target, so just add this
75
- // target element and assume the source will get resolved later.
76
- // debug('adding', target.__jsx, 'at', index);
77
- baseInstructions.push(insertNode(target, { parent, index }));
78
- } else {
79
- // no matching target, but something is in the index/slot ... so swap
80
- // debug('replacing', source.__jsx, target.__jsx, 'at', index);
81
- sourceMap.clear(source); // resolve source
82
- baseInstructions.push(replaceNode(source as Dom, target as Dom));
83
- }
84
- } else {
85
- // extra targets, add these to the end of the parent in order received
86
- // debug('adding target to end', target.__jsx);
87
- baseInstructions.push(insertNode(target, { parent, index }));
88
- }
89
- } else if (source) {
90
- // stuff has been remove from the target
91
- // check to see if source has been resolved in map
92
- // if not remove from dom
93
- const matchingSource = sourceMap.pullMatch(source);
94
- if (matchingSource.element) {
95
- // debug('removing', source.__jsx);
96
- baseInstructions.push(removeNode(source));
97
- }
98
- }
99
- }
100
-
101
- // deal with unresolved sources
102
- sourceMap.remaining().forEach(({ element }) => {
103
- // debug('removing', element.__jsx);
104
- baseInstructions.push(removeNode(element));
105
- });
106
-
107
- const nodeInstructions = nodesPairsToDiff
108
- .reduce((collection, { source, target }) => {
109
- return collection.concat(compileForNode(source, target));
110
- }, [] as Instructions);
111
-
112
- return baseInstructions.concat(nodeInstructions).sort(instructionsSorter);
113
- };
114
-
115
- const instructionsSorter = (left: Instruction, right: Instruction) => {
116
- if (left.type > right.type) return 1;
117
- if (left.type < right.type) return -1;
118
- return 0;
119
- };
120
-
121
- const largerLength = (sourceList: HtmlChildren, targetList: HtmlChildren) => {
122
- const sourceLength = Array.from(sourceList).length;
123
- const targetLength = Array.from(targetList).length;
124
- return sourceLength > targetLength ? sourceLength : targetLength;
125
- };
126
-
127
- const compileForNode = compileForNodeGenerator(compileChildren);