Framework: Clearing Search Index
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
Use deleteAll()
method on a search query to, well, delete all entries from a search index.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
Use deleteAll()
method on a search query to, well, delete all entries from a search index.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 3 minutes read
While testing notification logic in Osm Admin, an exception is thrown in $db->committing()
callback, and the logic in $db->rollback()
fails.
Let's review how transaction callbacks work, and fix it.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
A View
is a short-living object that is created and computed during page rendering. You can also create a pre-configured a View
object prototype in advance, and then clone it for rendering.
It's important not to execute render-time properties while configuring the prototype.
Use view()
helper function to create render-time view instances, and mark render-time properties using #[RenderTime]
attribute to prevent accessing them before rendering.
2 years ago ∙ 1 minute read
Yesterday, I optimized search responses, made search hit limit explicit, and decided not to obfuscate ID in URL.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
The implementation of the faceted implementation in osm.software
blog has shown that sometimes you need only facet counts, or only total count of matching entries.
Until now, Osm Framework had always queried total count
, ids
and facets
. Not anymore - and the search engine only provides the information that is actually needed.
2022 ∙ March ∙ Osm Framework
2 years ago ∙ 1 minute read
The implicit ElasticSearch hit limit is confusing. And you can't get all the hits - there is 10000 maximum hit limit that you can't exceed anyway.
Be explicit about the maximum number of search hits.
2 years ago ∙ 2 minutes read
In Osm Admin, I've finished indexing. It means that whenever you modify an object in the database, the changes are automatically propagated to all dependent indexed properties in the database.
I've also introduced a grid/form pair as the main user interface concept that is optimized for performing operations on multiple objects. There is also a programming interface (API) that will internally work in the same way, but without visuals. I implemented a part of this interface - an object creation form.
Osm Framework and all projects built with it - including this website and Osm Admin - are upgraded to TailwindCSS 3.0.
2 years ago ∙ 3 minutes read
For the last two weeks, I figured out two core features that will allow Osm Admin to stand out from other CRUD applications:
The foundation for the mass editing feature is data queries. Data propagation will be ensured via indexing.
I've been working on the Osm Admin indexing engine, and it's still in progress. While working on it, I reworked the inner working of data queries. Finally, I've achieved a very clear separation of various Osm Admin concerns, and documented it.
In Osm Core, I added reflection over class methods.
2 years ago ∙ 3 minutes read
I had two weeks full of meaningful, productive work. I started with sketching Osm Admin grid and form pages, and implemented a very basic, but working home page, and success/error messages. To enable that, Osm Framework now have extensible Blade templates, and a nice JavaScript solution for capturing user input into a modal dialog box, or into some picker component.
Then, I undertook a major refactoring of Osm Admin, including moving lots of pieces of code to their new places, stabilizing the underlying object model, rewriting database migrations and sketching future effort on data indexing. During this effort, I implemented generic object hydration and reflection over named subtypes.
I've already shared most of this information on Twitter, so if you are reading this, consider following me on Twitter and getting daily updates.
2021 ∙ November ∙ Osm Framework
2 years ago ∙ 2 minutes read
Recently, I developed a couple of helper functions for transmitting PHP objects over the wire, and saving them in database records:
dehydrate()
- recursively converts an instance of a PHP class to a plain untyped object. Then, store the plain object in the database, or convert it to JSON and send it to a browser.hydrate()
- recursively converts a plain untyped object back to a PHP class instance. Use if after decoding a JSON received from the browser, or after loading a database record.This article describes how to use these functions.
2021 ∙ November ∙ Osm Framework
2 years ago ∙ 2 minutes read
When active, modal elements - dialogs, pickers, or AJAX spinners - need to prevent user interaction with the rest of the page.
A common approach is putting an overlay <div>
under the modal element covering the rest of the page, as a click shield. However, user can still navigate the page with the keyboard.
Today, I implemented a better solution by capturing mouse and keyboard events outside the modal element, and keeping focus inside.
2021 ∙ November ∙ Osm Framework
2 years ago ∙ 2 minutes read
Currently, I'm working on Osm Admin package, and I need a module to inject its HTML markup around some well-known place in a Blade template. However, Blade template extensibility is not a problem that's specific to Osm Admin project. It's a generic problem. Let's solve that.
2 years ago ∙ 2 minutes read
I had two very productive weeks. #buildinpublic works wonders.
Most effort went into my new project, Osm Admin. I sketched how data classes look like, generated database tables from class attributes, and started working on the Admin UI. It's very fulfilling to see how an abstract idea gains shape.
3 years ago ∙ 3 minutes read
New Osm Framework version comes with improved, configurable and easily
customizable Gulp script, modular NPM dependencies, standard page layout Blade
component and brand new README
. osm.software website
contains an easy-to-follow new project installation instruction.
3 years ago ∙ 1 minute read
This article describes how we use GitHub issues and projects, both for new development and for support.
2021 ∙ August ∙ Osm Framework
3 years ago ∙ 1 minute read
Install and use osm
, osmc
, osmt
and osmh
command line aliases for faster command typing.
Note. This post is moved to Osm Framework documentation.
2021 ∙ August ∙ Osm Framework
3 years ago ∙ 1 minute read
Once PHP 8, Node and Gulp are installed, create new projects quickly using the command line.
Note. This post is moved to Osm Framework documentation.
3 years ago ∙ 1 minute read
The first osm.software blog articles have been written, edited and revised. Content changes are deployed in semi-automated way. The website got some SEO improvements, and now it scores 100% in Google Lighthouse.
3 years ago ∙ 2 minutes read
osmcommerce.com (now osm.software) blog got multi-select layered navigation, category management, FontAwesome icons, Tailwind CSS Typography. Osm Core allows debugging accidental assignments of the computed properties.