Repository navigation
feat: add browser capture presets for Inertia.js, Hotwire Turbo, htmx and Vite - #96
Merged
Merged
Conversation
… and Vite Browser capture presets live in a new browser directory beside packages, and index.json lists them under browser_presets, so binaries that predate browser capture never read either. Each preset names the DOM events a frontend library fires when something fails and the composer and npm packages that show a project uses it.
…ship them The presets move out of their own browser directory into packages, where lerd already detects what a project uses. A package definition can now say it is an npm package with an optional type, composer staying the default, and declare the DOM events its library fires in a browser block, which names the preset it belongs to so the Inertia, Turbo, htmx and Vite packages that share one are offered as one. npm packages are listed in the index with their type and live under an npm- prefix, so a name can never collide with a composer package. An older lerd only looks a package up once composer has installed it, which an npm name never is, and reads a composer package's file without the keys it does not know, so none of this reaches a version that cannot use it.
A released lerd fetches every entry of packages on lerd update and refuses a name composer could not publish, so the npm entries would have counted as failed refreshes on every install. They move to npm_packages, a key no released lerd reads, and the files keep their type and their place in packages.
Every lerd since the package layer fetches each entry of packages on lerd update and refuses a name composer could not publish, so such an entry would fail a refresh on every install. The README says why at the rule for listing a package, and the schema guard now refuses one, pointing at a key of its own such as npm_packages.
This was referenced Oct 5, 2026
Member
|
@ExeQue one change here to go with the lerd side, the Inertia presets should use message: detail.response instead of detail.response.status, in both inertiajs-inertia-laravel.yaml and the npm-inertiajs files. lerd now prints an axios response as status, method and URL, so you get something like 500 GET https://site.test/some/route instead of just 500. |
The Inertia presets read only detail.response.status, so an invalid response arrived as a bare 500. lerd now prints the axios response Inertia hands its events as its status, method and URL, so the presets point at detail.response and the dashboard shows which request failed, like 500 GET https://site.test/some/route.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the first browser capture presets, for lerd-env/lerd#2094. A preset lists the DOM events a frontend library fires when something fails, together with the composer and npm packages that show a project uses the library, and lerd offers the detected ones in a site's Browser settings with one click. The presets live in a new
browser/directory besidepackages/, andindex.jsongains abrowser_presetslist naming them, so binaries that predate browser capture never look at either.Inertia.js reports
inertia:invalidandinertia:exception, Hotwire Turboturbo:fetch-request-errorandturbo:frame-missing, htmx its response, send and swap errors, and Vitevite:preloadErrorfor a chunk that failed to load. A preset holds only event names and dot paths into the event, never code, since the capture script runs on every page of a site.Refs lerd-env/lerd#2089