Repository navigation
Releases
v1.1.10
The JOPS website is live: jops.ui-db.com, with guides for every platform, concepts, the full API reference and examples. The library is identical to 1.1.9.
Docs
- The npm package's homepage is now https://jops.ui-db.com, and the README links to it at the top.
- JOPS WordPress plugin: "Visit plugin site" opens the WordPress guide on the website, and the author link points to https://ui-db.com.
v1.1.9
Documentation only. The library is identical to 1.1.8.
Docs
Storeis described as an app-wide shared data store instead of a state container, since it stores data and has no reactivity: README heading "Store— Shared Data Store", AI guide heading "Shared data and events:StoreandEventBus", and theStoredescription in the type definitions.
v1.1.8
Fixes for npm install in projects created with npx jops-core init, more complete type definitions, and documentation corrections. The library only adds the Element export; its behaviour is unchanged.
Fixes
npm installfailed where nobody can answer a question (CI, Docker) in web, Cordova and Capacitor projects created bynpx jops-core init: their"postinstall": "npx jops-core init"stopped at the template question and exited with an error. When input ends without an answer,initnow uses 5 (None), which only refreshes the library and adds what is missing. A piped answer (echo 2 | npx jops-core init) still works.initnow adds"postinstall": "jops-core update", which only copies the library. Existing projects keep their script; changing it tojops-core updateavoids the question.- Hello World template: the stylesheet was loaded twice (by
setStyle()and by a<link>in the layout); the layout's<link>is removed.Media.jsis referenced with a root-based path like the other views.
Types
Element(returned byget()andfind(id)) is exported, so it can be used in your own type annotations.Viewdeclares the optional lifecycle hooksonLayout(),onResume(),onPause()andonBackPressed(), so editors suggest and document them in subclasses.- Internal members (names starting with
_) are no longer part of the type definitions. hide(),show(),destroy()andinflate()describe their behaviour for layouts with several top-level elements.
Docs
- README:
setStyle()has no effect in any hosted mode (Next.js, WordPress,mount()), not only in Next.js; the default entry point whendata-appis missing (./src/App.js); the Electron exception to thefile://note; how the layout cache handles views loading the same file at the same moment; where to read route params; the missingimport { Router }in the Capacitor back-button example; the pin example uses the current version. - AI guide: written against 1.1.8; the same
setStyle()andpostinstallcorrections.
v1.1.7
Bug fix in addSubView(). Calls that worked before find the same container.
Fixes
addSubView(containerId, view)now finds its container the same way asget(): in every top-level element of the view's layout, in order, and the container may be a top-level element itself. Before, only the inside of the first top-level element was searched, so a container in a later top-level element (e.g.<h2>…</h2><table><tbody id="rows">) or a top-level container logged "no element #… in the view" and nothing was added.addSubView()with a container id that is not a valid CSS identifier (for example one starting with a digit) no longer throws aSyntaxError.
Docs
- README, AI guide and type definitions: the
addSubView()container lookup;insertSubView()inserts among the children of the first top-level element. TheaddSubView()parameter is namedcontainerIdin the type definitions, as in the README.
v1.1.6
Electron support in the CLI: a new Electron template, and init / update recognise Electron projects. The library is unchanged from 1.1.5.
New
npx jops-core inittemplate 4. Electron JOPS Desktop App: creates an Electron Forge project in the current folder (main process, preload bridge with two sample IPC calls, a JOPS SPA with a sidebar and<Router jops screens>, a Content-Security-Policy), vendors the library tosrc/lib/and runsnpm install. An existingpackage.jsonis merged (its entries are kept;jops-coregoes todevDependencies). "None" is now choice 5.initin an existing Electron project (Electron Forge's default template, or any project withelectroninpackage.jsonthat loads a plain HTML page): vendors the library into the page's folder (src/lib/), replaces Forge's sample page (kept asindex.forge.html) or patches your own with the import map, the module script and a Content-Security-Policy, copies templates 1 and 2 next toindex.htmlwith page-relative paths, movesjops-coretodevDependenciesand adds ajops:updatescript. Forge's vite and webpack templates are refused, since they bundle the page.--electronforces the project type.npx jops-core updaterefreshes the library in an Electron project;npx jops-core buildpoints tonpm run makethere.
Docs
- README: new section "Desktop Apps (Electron)": the template, adding JOPS to an existing Electron project, paths under
file://(page-relative, no leading./or/), calling the main process through the preload bridge, events from the main process, the Content-Security-Policy, conventions. CLI and init menu updated. - AI guide: Electron section, and the path rule per setup gets an Electron line.
v1.1.5
Documentation only, no code changes.
Docs
- README and AI guide, Router screens mode: how to style screens and the Router container through the
.jops-screenand.jops-routerclasses (e.g. padding inside every screen), and which properties the Router sets inline and therefore take precedence over app CSS (position,inset,overflowandbackgroundon screens;positionandoverflowon the container). Use--jops-screen-bgfor the screen background.
v1.1.4
Maintenance release: fixes for Router transition glitches in app-like layouts, and documentation corrections. A Router without the new screens attribute behaves exactly as in 1.1.3.
Fixes
Routerscreens mode, an opt-in fix for layouts where the Router fills part of a fixed app window (desktop, hybrid, a fixed toolbar). With<Router jops screens>, the Router renders into its own container (<div class="jops-router">, sized by the app's CSS) instead of the tag's parent element. Every route and stacked view is a full-size screen in it that scrolls on its own and has an opaque background (--jops-screen-bg, defaultCanvas). This fixes, for such layouts: views shrinking during theslideandfadetransitions, the previous view showing through the new one, the shared scroll position (Back now returns to where a list was scrolled), the transitions overwriting the parent element's inline styles, and views with several top-level elements switching without animation. A new view covers the current one, which stays alive underneath.
Docs
- README and AI guide: new "Screens mode" section in the Router docs; removed the outdated rule that a route's own layout (and the layout of a view added with
addSubView()) is not scanned for declared views, which no longer applies since 1.1.3.
v1.1.3
Bug fixes in rendering declared views (layouts with several top-level elements, top-level jops tags, views in Router routes, nested tags, views added with addSubView(), views removed while loading) and in the Router hiding routes. No API changes.
Fixes
- Views declared in a layout with more than one top-level element are now rendered in every top-level element. Before, only the declared views (
<X jops …>tags) inside the first top-level element were rendered; tags in the second and later elements stayed in the page as unrendered elements. - A declared view (
<X jops …>) or<Router jops>that is itself a top-level element of a layout is now rendered, e.g. a layout that starts with<Header jops …></Header>followed by other elements. Before, it was rendered only when wrapped in another element. The view that owns the layout keeps the rendered elements as its own, soget(),find(),hide()/show()and removing the view also cover them. - Views declared in the layout of a
Routerroute are now rendered. Before, a route rendered only the plain HTML of its layout, and its<X jops …>tags (and those of the views inside it) stayed in the page as unrendered elements, with no error. - The
Routernow hides inactive routes and covered stacked views even when the app's CSS sets theirdisplay(e.g..stats { display: grid }). It used only thehiddenattribute, which such CSS overrides, so the previous route stayed visible next to the new one. - A declared view nested inside another declared view's tag (
<Outer jops><Inner jops></Inner></Outer>) is now created once and belongs to the outer view. Before, both the outer view and the view containing it could create it, depending on load timing, so it was rendered twice or owned by the wrong view. - A view added with
addSubView()orinsertSubView()now renders the views declared in its layout (<X jops …>tags), before itsonLayout(), as a declared view does. Before, only its plain HTML was shown and those tags stayed unrendered. - A view removed while its declared views are still loading now stops them: the ones that finish loading afterwards are destroyed instead of running
onLayout()/onResume()and staying attached to the removed view.
v1.1.2
WordPress integration: a JOPS SPA can now run inside a WordPress page, next to the theme and the page's other content, through the new JOPS WordPress plugin. See the new README section "WordPress Integration".
WordPress integration
- New JOPS WordPress plugin with the
[jops]shortcode:[jops app="/jops-spa/src/App.js" id="jops-spa-root"]embeds a JOPS app in a page, e.g. with Elementor's Shortcode widget or the block editor's Shortcode block. Attributes:app,id,class,lib. The plugin includes the jops-core library. One app per page; in the Elementor editor the widget shows a placeholder, and the app runs on the published page. - Install without npm:
jops-wordpress.zipis attached to every GitHub release (always the newest:https://github.com/uidb-dev/jops-core/releases/latest/download/jops-wordpress.zip); install it with wp-admin → Plugins → Add New Plugin → Upload Plugin. To update, upload the newer zip and choose "Replace current with uploaded". npx jops-core init --wpinstalls the plugin with npm: intoplugins/jops/of awp-envproject (and adds it to.wp-env.json), otherwise into the plugins folder of the WordPress installation found in the current folder or above it (standard layout or Bedrock).--wp-root <path>points to WordPress instead of searching.npx jops-core updatealso refreshes an installed JOPS WordPress plugin and its library.
New API
View.removeSubViews(condition?): removes and destroys every subview, or only those matchingcondition(the others keep their order). Not available on aRouter(logs a warning).
Fixes
- The
jops:readyevent now fires after jops-core has fully initialised, so callingmount()from the listener no longer fails (it threwCannot set properties of undefined (setting 'pushState')when the listener was registered before the library loaded).
v1.1.1
Documentation only; no library changes.
- README: hosted mode (
data-host,mount()/unmount()) moved out of the Next.js section into its own section, "Embedding JOPS in Other Pages (Hosted Mode)", for plain HTML pages and other server frameworks. The example now loads the library from jsDelivr, and the section explains how paths resolve with the CDN (relative to the hosting page) and with a vendored library (root-absolute). Inside a Next.js page, always useJopsApp. - README:
data-root(render a standalone app into an element instead of<body>) is now documented in the CDN installation section.