Search
Items tagged with: JavaScript
JSDB 5.0.1 published š
ā¢ Fixes #14: Crash if DataProxy getHandler() called on object with null prototype. (https://codeberg.org/small-tech/jsdb/issues/14)
To install update:
npm install @small-tech/jsdb@5.0.1
Learn more about JSDB:
https://codeberg.org/small-tech/jsdb#javascript-database-jsdb
#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
To really drive home the above š point that 100% test coverage does not mean ābug freeā, just found a bug in JSDBĀ¹ 5.0.0 where running JSON.stringify() on a complex custom object (actually: the automatic Proxy of the custom object created by JSDB) results in an error.
Already have a failing test and about to implement fix.
(Itās at this point where the test harness is invaluable.)
Ā¹ https://codeberg.org/small-tech/jsdb
#JavaScriptDatabase #JavaScript #database #JSDB #JSDB5 #NodeJS #SmallWeb #SmallTech
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
If you use a parameter object in JavaScript, even if you specify its shape using JSDoc, youāll only get errors if required properties are missing; not if there are extra properties provided.
e.g.,
```js
class A {
/**
@param {{
id:string
}} params
*/
constructor (params) {
Object.assign(this, params)
}
}
// Error:
new A({})
// No error:
new A({id: 'x', foo:'bar'})
```
According to this thread, itās a fact-of-life:
Philosophically, JSDB ā which writes out to native JavaScript logs ā is very much the JavaScript version of SWX, the native data format for Flash that I released around 2007 (where data was written out in native SWF format). I have to say that Iām glad I didnāt have to reverse engineer SWF bytecode this time around :)
Hereās a video of a younger me doing an impromptu demo of SWX at some conference or other from 16 years ago.
https://m.youtube.com/watch?v=OM9qOADsO3w
#JSDB #SWX #JavaScript #Flash #flashback
100% test coverage doesnāt mean your codeās bug free but it did just lead me to find and fix an issue in JavaScript Database (JSDB)Ā¹ with a code path that wasnāt being hit that I would have otherwise missed because it was causing the relevant test to pass.
Ā¹ JSDB is a zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log (an append-only log).
https://codeberg.org/small-tech/jsdb
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
Just wrote a note about a little gotcha with default values for destructured properties of parameter objects in JavaScript that has gotten me a few times:
#JavaScript #destructuring #defaults #parameterObjects #web #dev
gists/default-values-for-destructured-properties-of-parameter-objects-in-javascript.md at main
gists - A place for me to post and share small, self-contained code snippets.Codeberg.org
Realised last night that JavaScript Database (JSDB) doesnāt run the constructor on persisted custom objects (https://codeberg.org/small-tech/jsdb#custom-data-types) when deserialising them because I didnāt know that you apparently have to define your constructor manually when using Object.create().
Will fix it today but itās something to watch out for if youāre using Object.create() directly.
For more info, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
#JSDB #customObjects #constructor #bug #JavaScript #NodeJS #SmallTech #SmallWeb
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
#Fedify is an #ActivityPub server framework in #TypeScript & #JavaScript. It aims to eliminate the complexity and redundant boilerplate code when building a federated server app, so that you can focus on your business logic and user experience.
The key features it provides currently are:
ā¢ Type-safe objects for Activity Vocabulary (including some vendor-specific extensions)
ā¢ #WebFinger client and server
ā¢ HTTP Signatures
ā¢ Middleware for handling webhooks
ā¢ #NodeInfo protocol
ā¢ #Node.js, #Deno, and #Bun support
If you're curious, take a look at the Fedify website! There's comprehensive docs, a demo, a tutorial, example code, and more:
Fedify
Fedify is a TypeScript library for building federated server apps powered by ActivityPub and other standards, so-called fediverse.fedify.dev
Little web dev tip: if you have just one address field in your HTML form (e.g., a textarea) but you still want the person filling it in to avail themselves of autocomplete, hereās a little reusable snippet you can use to achieve that:
(Ideally the web spec should be extended to include a full-address value for the autocomplete attribute.)
#HTML #autocomplete #JavaScript #address #web #dev #tip #code
gists/single-html-address-field-with-autocomplete-using-javascript.md at main
gists - A place for me to post and share small, self-contained code snippets.Codeberg.org
This is a niche one and will likely not affect any of the (three?) people playing with KittenĀ¹ right now but, in any case:
If you persist custom types to your Kitten database, you might be hit by this bug that was introduced when I released versions of Kitten with minified identifiers.
I briefly wrote about what happened, how you can identify if youāre affected, and how you can fix it here:
https://codeberg.org/kitten/app/issues/160#issuecomment-1775375
Pragmatic drag and drop lib that can be used with any view layer (react, svelte, vue, angular and so on).
Powers Trello, Jira and Confluence.
#TypeScript #JavaScript #opensource
https://github.com/atlassian/pragmatic-drag-and-drop #webdev
GitHub - atlassian/pragmatic-drag-and-drop: Fast drag and drop for any experience on any tech stack
Fast drag and drop for any experience on any tech stack - atlassian/pragmatic-drag-and-dropGitHub
freeCodeCamp
freeCodeCamp's open-source mobile app
freeCodeCamp.org is an online learning platform offering a comprehensive curriculum in #web development and machine learning. The curriculum is self-paced and available free of charge. The App includes challenges, tutorials, Code Radio, and podcasts.
Contribute to freeCodeCamp: https://contribute.freecodecamp.org/
Download: https://play.google.com/store/apps/details?id=org.freecodecamp
#FOSS #Android #OpenSource #Coding #Education #freeCodeCamp #OSS #Podcasts #python #Flutter #JavaScript #iOS
freeCodeCamp.org
Contributing documentation for working on freeCodeCamp's open source codebase.contribute.freecodecamp.org
Building a Live Search Feature with HTMX and PostgreSQL FTS
#django #htmx #javascript #programming #python #webdev
Build a Live Search Feature with Django using HTMX and PostgreSQL FTS (in 10 minutes)
We'll build an advanced search feature that automatically updates its results. No JavaScript required!circumeo.io
Enhancing pagination with a page selector // Cory Dransfeldt
I've made a change to my site's pagination wherein I've enhanced the page count displayed at the bottom of my home and links pages to display the page count in a select element.Cory Dransfeldt
Hey, all! On stream today we'll be making more updates to the Andromeda website, making use of Eleventy - check them out at @eleventy, and come hang out with us in chat!
https://www.twitch.tv/martine_dowden
#webdev #Eleventy #11ty #HTML #CSS #JavaScript
Martine_Dowden - Twitch
Award winning CTO, UX / UI designer & developer / international speaker and author focusing on web interfaces that are beautiful, functional, accessible, and usable.Twitch
Just improved the display of error messages in KittenĀ¹.
They should be far more robust now.
Run `kitten update` to get the latest.
š
Ā¹ https://codeberg.org/kitten/app
#Kitten #errorMessages #stackTrace #web #dev #JavaScript #nodeJS
Building a scrobbler using Plex webhooks, edge functions and blob storage // Cory Dransfeldt
I've written before about embedding music into my site and I've largely used Last.fm to do so. Their API is rather extensive, though it is showing its age ā the default response format is XML, they've dropped artist images and have intermittently faiā¦Cory Dransfeldt