Code Monkey home page Code Monkey logo

dibello's Introduction

rezonant

Mastodon | Twitter | LinkedIn | Email me, I'm wilahti on gmail.com | Want to support my work? Sponsor me! I'm also on Venmo

Hello! My name is Liam. I work at TYT in the daytime and am hacking away at my broadcast software startup Astronaut Labs in the night time hours. I am passionate about all things media, especially audio and video systems. I have over fifteen years of experience as a professional software engineer and have worked on projects in many domains like health care, printshops, SMS marketing, and of course, lots and lots of media, both on the consumer side as well as professional media production tooling.

I have been in the open source community for at least twenty years, and have contributed code to a number of smaller projects, like Slicker (KDE Kicker replacement), SharpOS (a hobbyist OS written in C#). I have participated in community discussions in Mono (an open source .NET implementation), X.org, and KDE. I also have a number of open source projects that I'm actively developing today.

my politics

I am a politics junkie. I am unabashedly progressive. I participate in Democratic Socialists of America, I stand with Black Lives Matter, and I vote. I supported Bernie Sanders in 2016 and 2020. As you can imagine, my work at TYT is very satisfying for me. Fun fact: I got to meet Alexandria Ocasio Cortez in person when she came on The Young Turks some time after she won her primary and before she won the general election in 2018!

my projects

  • devtools -- All your devtools in one place
  • poker -- A simple standalone planning poker app
  • sliptap -- Sliptap is a search engine focusing on media. Sliptap is constantly crawling the web and building an index of the world's media using JSON-LD and OpenGraph metadata.
  • @astronautlabs/diazo -- Diazo is a directed acyclical graph editor component for Angular in the style of Unreal Engine's Blueprint system. It can be used for lots of domains and use cases!
  • @astronautlabs/broadcast -- I am the author of Astronaut Labs' broadcast stack, which implements tons of audio/video/broadcast specifications in Typescript for use in our products and by the community at large.
  • alterior -- Alterior is an application framework that primarily facilitates Node.js server applications of all types. It uses a dependency injection system that is similar to Angular, and you can even create libraries that can be consumed both in Alterior apps (backend) and Angular (frontend) apps, making it isomorphic.
  • razmin -- Razmin is a new take on the classic Jasmine/Mocha style test framework, but modernized to match Typescript conventions and using Zone.js to make testing asynchronous code simpler and more reliable.

my stack

Over the years I have honed my preferred toolset quite a lot. Find below a list of components that I use (in addition to my libraries above) for almost every project. I've worked with many alternatives to the tech listed below, but I've found these solutions pack the best punch.

  • Windows -- There was a time where I was not a fan of Windows, but through years of working with the Windows stack, especially .NET/C#, I have grown to appreciate its power. I use Windows for all of my desktop computing, and I do all of my development on Windows. I also have a good amount of experience administering enterprise Windows deployments including Windows Server (ActiveDirectory, Domains, SQL Server / IIS / ASP.NET)
  • Linux -- Though I do my development on Windows, I deploy on Linux. I have been using Linux since circa 2003, and my first Linux distribution was Slackware, which I learned on my own as an angsty nerdy teenager. I have a deep understanding of Linux' architecture, having built experimental distributions based on Linux for fun.
  • Kubernetes -- Abstract cloud native applications is today's reality.
  • Linode -- Deploy your Kubernetes workloads here
  • Typescript -- When I was introduced to Typescript with Angular 2, I fell in love. Fast forward to now (Angular 10 was just released) and I now use Typescript exclusively when building browser apps and Node.js services.
  • Node.js -- I default to Node.js when building new server-side services, because I believe that the benefits of one language across frontend and backend is the most important consideration.
  • Rust -- When Node.js isn't performant/low-level/etc enough, I reach for Rust.
  • Angular -- I have been writing apps in Angular since Angular 2 beta (circa December 2015), and I was using AngularJS before that. I am enthusiastic and strongly invested in Angular as a platform, and I really love building apps with it
  • Angular Material -- The Google Material Design implementation for Angular, Angular Material provides a rich suite of user interface controls that rarely leaves me wanting.
  • Visual Studio Code -- I spend most of my day in front of VS Code and so should you!
  • zone.js -- Zone.js is one of the most powerful libraries in my stack. A lot of the libraries I've built use it for one reason or another.

side projects

  • streamatik -- Streamatik is a good looking Twitch multi-viewer.
  • rezone -- I ❤️ zone.js, but I believe its API is difficult to use and somewhat overcomplicated. Zone.js also needs to become part of ECMAScript in order to continue working as new features like native async/await grow in usage, but standardization efforts have stalled for a number of reasons. Rezone aims to tackle both of these issues, creating a simpler, easier to use, and more intuitive API for zones, as well as proposes that its API become part of the ECMAScript standard, picking up where Domenic Denicola's Zones proposal left off

dibello's People

Contributors

rafis avatar rezonant avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rafis

dibello's Issues

Why other async operations are disallowed within transaction?

Help me please to understand why the following code does not work?

describe('Database with foreign key relations', function() {

    it("transaction should not break by third-party asynchronous operations like delay", async function() {

        const db = await Database.open('test123', {
            version: 2,
            migrations: {
                "1": function(schema) {
                    schema.createStore('trees')
                        .id('id')
                        .key('color')
                        .field('history');
                },
                "2": function(schema) {
                    schema.createStore('apples')
                        .id('id')
                        .foreign('tree_id', 'trees.id')
                        .field('size');
                }
            }
        });

        await db.transact('readwrite', async function(trees, apples) {

            const result = await apples.find({ size: 'average' });
            const item = await result.next();
            let apple = item.value;
            
            if (!apple) {
                let tree = {
                    id: '1',
                    color: 'red'
                };
                await trees.persist(tree);
                apple = {
                    id: '1',
                    tree_id: tree.id,
                    size: 'average'
                };
            }

            function delay(ms) {
                return new Promise(resolve => setTimeout(resolve, ms));
            }

            await delay(1); // this breaks the test
        
            await apples.persist(apple);

        });

    });

});

Without await delay(1); the test works.

Help me please to compile

Thank you for the excellent lib. Before choosing it I was considering idb, indexeddb-orm, but I think your lib is most promising. I'm new to these new trends like esnext, typescript, webpack3 and to the for ever changing build tools for web development. Help me please to compile my code with the lib.

> [email protected] build C:\dev\project1\extension
> webpack

ts-loader: Using [email protected] and C:\dev\project1\extension\tsconfig.json
Hash: 2d4893eecd44fbec0aa5
Version: webpack 3.7.0
Time: 2323ms
            Asset       Size  Chunks                    Chunk Names
         popup.js    92.6 kB       0  [emitted]         popup
       options.js    1.26 kB       1  [emitted]         options
content_script.js  432 bytes       2  [emitted]         content_script
    background.js  189 bytes       3  [emitted]         background
        vendor.js     404 kB       4  [emitted]  [big]  vendor
   [3] (webpack)/buildin/global.js 509 bytes {0} [built]
   [4] ./src/popup.ts 1.47 kB {0} [built]
   [5] (webpack)/buildin/module.js 517 bytes {4} [built]
   [6] ./src/db/Db.ts 640 bytes {0} [built]
  [27] ./src/options.ts 1.15 kB {1} [built]
  [28] ./src/content_script.ts 346 bytes {2} [built]
  [29] ./src/background.ts 103 bytes {3} [built]
  [30] multi moment jquery 40 bytes {4} [built]
    + 23 hidden modules

ERROR in ./node_modules/dibello/src/constraint.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\constraint.ts Unexpected token (6:36)
You may need an appropriate loader to handle this file type.
|  */
| export class Constraint {
| 	constructor(operator, discriminant : string | { fieldName : string, constraint : Constraint }[], idb) {
| 		this.operator = operator;
| 		this.discriminant = discriminant;
 @ ./node_modules/dibello/index.js 7:9-36
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/database.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\database.ts Unexpected token (23:20)
You may need an appropriate loader to handle this file type.
|  */
| export class Database {
| 	constructor(schema : SchemaBuilder, idb) {
| 		if (!schema)
| 			throw "Must pass a SchemaBuilder as 'schema' to the dibello.Database constructor";
 @ ./node_modules/dibello/index.js 8:9-34
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/index.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\index.ts Unexpected token (6:18)
You may need an appropriate loader to handle this file type.
| import { idbRequestToIterable } from './utils/idb/request-to-iterable';
| 
| export class Index<TModel, TIndex> {
|     constructor(repository : Repository<TModel>, name : string) {
|         this._name = name;
 @ ./node_modules/dibello/index.js 9:9-31
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/polyfill.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\polyfill.ts Unexpected token (5:9)
You may need an appropriate loader to handle this file type.
| 
| if (typeof window !== 'undefined') {
| 	let win : any = window;
| 	win.indexedDB = win.indexedDB || win.mozIndexedDB || win.webkitIndexedDB || win.msIndexedDB;
| 	win.IDBTransaction = win.IDBTransaction || win.webkitIDBTransaction || win.msIDBTransaction;
 @ ./node_modules/dibello/index.js 6:0-25
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/repository.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\repository.ts Unexpected token (26:23)
You may need an appropriate loader to handle this file type.
|  * Provides a high-level API on top of an IndexedDB object store (IDBObjectStore)
|  */
| export class Repository<T> {
| 	constructor(db : Database | Promise<Database>, storeName : string, transaction? : IDBTransaction) {
| 		var self = this;
 @ ./node_modules/dibello/index.js 10:9-36
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/schema-builder.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\schema-builder.ts Unexpected token (21:27)
You may need an appropriate loader to handle this file type.
|  */
| export class SchemaBuilder {
| 	constructor(name, registry?) {
| 		this.name = name;
| 		this.stores = {};
 @ ./node_modules/dibello/index.js 11:9-40
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/store-builder.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\store-builder.ts The keyword 'private' is reserved (20:14)
You may need an appropriate loader to handle this file type.
| 
| export class StoreBuilder { 
| 	constructor (private builder : SchemaBuilder, private name : string, id : string) {
| 		this.store = {
| 			primaryKey: id,
 @ ./node_modules/dibello/index.js 12:9-39
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/transact.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\transact.ts Unexpected token (38:24)
You may need an appropriate loader to handle this file type.
|  * @returns {Promise} A promise to resolve once the transaction has fully completed.
|  */
| export function transact<T>(db, transactionOrFactory, repositoryFactory, fn : (...args) => T, mode, extraInjectables?): T {
| 	var mode = mode || 'readonly';
| 	var idb = db.idb();
 @ ./node_modules/dibello/index.js 14:9-34
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/utils/iterator-collect.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\utils\iterator-collect.ts Unexpected token (1:37)
You may need an appropriate loader to handle this file type.
| export async function iteratorCollect<T>(iterator : AsyncIterable<T>, callback : (items : T[]) => void) {
|     let items = [];
|     for await (let item of iterator)
 @ ./node_modules/dibello/index.js 16:9-48
 @ ./src/db/Db.ts
 @ ./src/popup.ts

ERROR in ./node_modules/dibello/src/utils/iterator-for-each.ts
Module parse failed: C:\dev\project1\extension\node_modules\dibello\src\utils\iterator-for-each.ts Unexpected token (8:37)
You may need an appropriate loader to handle this file type.
|  * @param callback The callback to call for each round.
|  */
| export async function iteratorForEach<T>(iterable : AsyncIterable<T>, callback : (result : IteratorResult<T>) => boolean) {
|     for await (let item of iterable) {
|         if (!callback({ value: item, done: false }))
 @ ./node_modules/dibello/index.js 15:9-49
 @ ./src/db/Db.ts
 @ ./src/popup.ts
Done.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\rafis\AppData\Roaming\npm-cache\_logs\2017-12-08T11_52_56_273Z-debug.log

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "lib": [
            "dom",
            "es2015",
            "es2015.iterable",
            "esnext.asynciterable"
        ],
        "noImplicitAny": false,
        "sourceMap": false,
        "rootDir": "src",
        "outDir": "dist/js",
        "noEmitOnError": true
    }
}

If I change exclude of ts-loader in webpack config to include compiling dibello source code in node_modules then I'm getting following error:

You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.