@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-idb-keyval/>
  a sioc:Post ;
  dc:title "Architecture" ;
  dcterms:identifier 152637 ;
  dc:modified "2026-10-27T12:21:25Z"^^xsd:dateTime ;
  dc:created "2026-10-27T12:21:25Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-idb-keyval/architecture/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded "<ul class=\"lh_portfolio-meta\"><li><strong>Part of:</strong> <a href=\"https://lhero.org/portfolio/lh-idb-keyval/\">LH idb-keyval</a></li></ul><p class=\"wp-block-paragraph\">One class, <code>LH_Idb_Keyval</code>, in the main file. On <code>init</code> priority 0 it registers the <code>idb-keyval</code> script module from <code>assets/lib/index.js</code>, versioned with the plugin version, then fires <code>lh_idb_keyval_registered</code>. Consuming plugins test that action to decide whether to fall back to their own copy.</p><h2 class=\"wp-block-heading\">Files</h2><ul class=\"wp-block-list\"><li><code>assets/lib/index.js</code>: the library&#8217;s ES module build, verbatim from the npm package.</li><li><code>assets/lib/umd.js</code>: an unminified classic build for service workers and classic scripts. It defines the <code>idbKeyval</code> global. Upstream only publishes a minified one, so this is the ES module build wrapped in a UMD factory, with the library code unchanged.</li><li><code>assets/lib/LICENSE</code>: the library&#8217;s Apache-2.0 licence.</li><li><code>snippets/lh-idb-keyval-fallback.php</code>: the canonical fallback snippet for consuming plugins. This plugin never loads it.</li></ul><h2 class=\"wp-block-heading\">Public methods</h2><ul class=\"wp-block-list\"><li><code>get_umd_url()</code>: URL of the classic build, with a <code>ver</code> query string so a library update busts service worker and HTTP caches.</li><li><code>get_module_url()</code>: URL of the ES module build.</li><li><code>return_module_id()</code>: always <code>idb-keyval</code>. Not filterable, because consumers import by that name and the snippet registers under it.</li></ul><h2 class=\"wp-block-heading\">Updating the library</h2><p class=\"wp-block-paragraph\">Replace <code>index.js</code> from the new npm release, regenerate <code>umd.js</code> by wrapping it the same way, and release with <code>bump_version</code> set to the library version. This plugin retires with the library.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH idb-keyvalOne class, LH_Idb_Keyval, in the main file. On init priority 0 it registers the idb-keyval script module from assets/lib/index.js, versioned with the plugin version, then fires lh_idb_keyval_registered. Consuming plugins test that action to decide whether to fall back to their own copy.Filesassets/lib/index.js: the library&#8217;s ES module build, verbatim from the npm package.assets/lib/umd.js: an unminified classic build for service workers and classic scripts. It defines the idbKeyval global. Upstream only publishes a minified one, so this is the ES module build wrapped in a UMD factory, with the library code unchanged.assets/lib/LICENSE: the library&#8217;s Apache-2.0 licence.snippets/lh-idb-keyval-fallback.php: the canonical fallback snippet for consuming plugins. This plugin never loads it.Public methodsget_umd_url(): URL of the classic build, with a ver query string so a library update busts service worker and HTTP caches.get_module_url(): URL of the ES module build.return_module_id(): always idb-keyval. Not filterable, because consumers import by that name and the snippet registers under it.Updating the libraryReplace index.js from the new npm release, regenerate umd.js by wrapping it the same way, and release with bump_version set to the library version. This plugin retires with the library." ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
