Repository navigation
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).