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 ∙ 1 minute read
This sprint was dedicated to writing Osm Framework documentation, and indeed, there are 8 new in-depth documentation articles, 4-5 minutes long each.
Despite documentation focus, I kept improving the website. From now on, you can assign a canonical URL to a blog post or a documentation page, and use GitHub friendly relative URLs in documentation.
But the most important thing - I started sharing progress and insights daily on Twitter.
2021 ∙ October ∙ Osm Framework
3 years ago ∙ 1 minute read
Throw the NotImplemented
exception in any code path that is not implemented yet, and configure the debugger to stop there whenever the code path is executed.
3 years ago ∙ 4 minutes read
osm.software
website. From now on, Osm Framework documentation resides in the docs/
directory of the osmphp/framework
repository, and it is displayed in a separate section of osm.software
website. New data source indexing engine allows running complex interdependent data synchronization with a single command, osm index
. New Placeholder
class simplifies dynamic Markdown content generation.
Osm Framework. Apply dynamic traits within the same file using #[UseIn]
attribute. Implement fast dynamic routing using new DynamicRoute
class. Generate URLs using new $osm_app->base_url
property.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 1 minute read
After you got a project up and running, let's have a look what's inside. Every directory has its purpose. Learn where to put your creative efforts!
Note. This post is moved to Osm Framework documentation.
3 years ago ∙ 2 minutes read
This website got a completely new look. There are new blog posts diving into core Osm Framework features. Osm Framework itself offers more convenient page layout, website-wide header, footer and <head>
, customizable error pages. The themes support theme-specific CSS styles and JS scripts not bound to any module. New projects come with a handy bin/install.sh
script that simplifies installation on Linux. From now on, run osmh
without any parameters.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 4 minutes read
In Osm Framework, an application is a set of modules that you run as a whole. There are several applications defined in the project, each having its own PHP class. Mostly, deal with the main one, Osm\App\App
. Beside the class name, every application also has a name, the main one is named Osm_App
.
Access the current application object, and the main parts of Osm Framework, via the global $osm_app
object and its properties. Add your own long-living objects there. Run an application using its HTTP or console entry point, or using Apps::run()
.
Note. This post is moved to Osm Framework documentation.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 4 minutes read
Modular software development is a well-known practice of dividing your application into several modules, each doing one thing, and doing it well. It increases readability and simplifies maintenance, as application concerns are fully separated from one another, easier to reason about, and to debug.
Modular development also encourages reuse. It's like a puzzle. Using one set of modules, you'll get an e-commerce application, using another set of modules - you'll get a blog application.
Note. This post is moved to Osm Framework documentation.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 3 minutes read
Using dynamic traits, customize anything. Inject your code in the beginning, in the end, or instead of any standard method. Even more, add new properties and methods to the existing standard classes.
Note. This post is moved to Osm Framework documentation.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 5 minutes read
Computed properties are one of Osm Framework pillars. They help to execute code only once, and only if it's actually needed. Computed properties control object serialization and caching. They provide meaningful insights into class interdependencies. Finally, computed properties are easy to test.
Note. This post is moved to Osm Framework documentation.
3 years ago ∙ 2 minutes read
From now on, this website is deployed on push, and by the way, you can easily play with the website copy locally. In the Osm framework, new Osm_Project
application allows reflecting over modules and classes regardless to which application they belong. New experimental project is aimed at quick creation of the Admin UI.
2021 ∙ September ∙ Osm Framework
3 years ago ∙ 2 minutes read
Osm Framework uses Monolog library for logging. Use standard loggers defined in the $osm_app->logs
object, or add your own. Control logging in the settings.{app_name}.php
and .env.{app_name}
files.
Note. This post is moved to Osm Framework documentation.
3 years ago ∙ 1 minute read
This article describes our package release process before v1.0.0
. In short,
every change is released as soon as it's ready, and all dependent packages are
updated at the same time.
3 years ago ∙ 1 minute read
This article provides a practical example of contributing changes to Osm Framework
and other osmphp/*
GitHub repositories. It's based
on the Osm_Project
application pull request.
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 ∙ 1 minute read
Osm Framework introduced production mode and maintenance mode. osm.software website went live.
3 years ago ∙ 1 minute read
Osm Framework introduced JS controllers, and JS unit tests. osmcommerce.com website project was renamed to osm.software, it finalized the post rendering, and introduced a tool for checking broken links.
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.
2021 ∙ May ∙ Osm Framework
3 years ago ∙ 4 minutes read
Full-text search and layered navigation is a common feature for e-commerce applications. It's also used in this blog. Actually, it makes browsing any non-trivial data better. Under the hood, search and layered navigation interact with ElasticSearch, or other search engine, and this article describes how.
Note. This post is moved to Osm Framework documentation.
2021 ∙ May ∙ Osm Framework
3 years ago ∙ 3 minutes read
Osm Framework is an open-source, insanely fast, unprecedentedly extensible, and fun to work with PHP 8 framework for creating modern Web applications. It's built on top of tried and tested Symfony and Laravel components.
Note. This post is moved to Osm Framework documentation.