profile
viewpoint
Tanner Nielsen tannerntannern United States tannernielsen.com

tannerntannern/ts-mixer 77

A small TypeScript library that provides tolerable Mixin functionality.

tannerntannern/micro-observer 21

Utilizes ES6 Proxies to easily observe and validate changes on nested objects.

tannerntannern/arithmetic-types 6

Stupidly over-engineered integer arithmetic for TypeScript

tannerntannern/docker-vaultier 6

An awesome, free, secure, key-based, multi-user, self-hosted password manager for teams.

tannerntannern/adapter 2

A tiny TypeScript helper for making I/O agnostic utilities.

tannerntannern/inquirer-emoji 2

Emoji search and select prompt for inquirer

jordanhe2/ediTable 1

A simple excel-like table for HTML.

tannerntannern/plopify 1

A Plop-inspired tool that takes project templating to the next level.

tannerntannern/blog 0

Hosting for my blog

startedIronOxidizer/alpine-persistent-usb

started time in 5 days

startedmsgpack/msgpack-javascript

started time in 6 days

issue commenttannerntannern/ts-mixer

How does it work under the hood?

In the meantime this might shine some light on how the mixing is accomplished under the hood

yaquawa

comment created time in 6 days

issue commenttannerntannern/ts-mixer

How does it work under the hood?

Hi @yaquawa, thanks for the interest in the library. I think some diagrams illustrating the two underlying mixing methods (prototype mixing and proxying) would be helpful for people to see, especially for those who would like make contributions. I haven't had time to work on this project lately, so it's hard to say when I'd be able to get around to it, but I will leave this issue open as a reminder. If anyone else would like to draft up some diagrams, PRs are welcome!

yaquawa

comment created time in 7 days

starteddtan4/s3url

started time in 8 days

starteddtan4/s3url

started time in 8 days

startedtabler/tabler-icons

started time in 16 days

issue closedNREL/developer.nrel.gov

Wrong default `utc` value for psm3 data download API

I'm currently using the psm3 data download API, and it seems that these docs list the incorrect default value for the utc parameter.

For example, this is the URL I'm hitting: https://developer.nrel.gov/api/solar/nsrdb_psm3_download.csv?api_key=<key>&email=<email>&attributes=clearsky_ghi,solar_zenith_angle&interval=60&names=2014&wkt=POINT(-108.5449 48.5137)

When I omit the utc parameter, I get the same results as when I pass utc=false. And when I pass utc=true, I get different results. From this information it seems that false is the default, but the docs say the default is true. Which is correct?

closed time in 23 days

tannerntannern

issue commentNREL/developer.nrel.gov

Wrong default `utc` value for psm3 data download API

@PjEdwards @reger, I'm not sure if the behavior of the API has been changed as a result of this issue, but it now appears that ?utc=false and ?utc=true don't have any effect??

tannerntannern

comment created time in a month

startedianramzy/decentralized-video-chat

started time in a month

issue openedkimamula/ts-transformer-keys

Goes against TypeScript Design Goals?

Interesting project! However, according to the TypeScript design goals, it seems that having the type system "leak" into runtime would go against the goal of a "fully erasable type system."

I don't intend to just be a naysayer! I want to know more about the thinking behind this project and what it solves that can't be solved in TypeScript as it stands today.

created time in a month

issue commentmicrosoft/TypeScript

maintain certain class property characteristics in mapped types, like protected/private visibility, and instance property vs instance function

@trusktr, it's not entirely clear to me what you're looking for based on this thread, but I believe the typing you're looking for can already be achieved without changes to TypeScript's internals.

trusktr

comment created time in 2 months

issue commentdata-forge/data-forge-ts

Streaming on rows as they are parsed

@ashleydavis, I would love to but I've got lots of projects competing for my time at the moment. Might be quite some time before I'd be able to get around to it. Mostly curious if this was already in the works or if I missed something in the docs that makes streaming possible.

vallettea

comment created time in 2 months

push eventtannerntannern/ts-mixer

Matthew Wolfe

commit sha 715fef06bafcb7d9ee736b48d962257986216771

Update README.md

view details

Tanner Nielsen

commit sha db432a91b6e041d2001eca3f4f8148af1798ad65

Merge pull request #29 from matthewwolfe/patch-1 Fix typo in readme

view details

push time in 2 months

PR merged tannerntannern/ts-mixer

Fix typo in readme

Cool project :) Was reading the readme and saw a typo. Thanks for the great work!

+1 -1

2 comments

1 changed file

matthewwolfe

pr closed time in 2 months

pull request commenttannerntannern/ts-mixer

Fix typo in readme

Thanks @matthewwolfe!

matthewwolfe

comment created time in 2 months

issue commentdata-forge/data-forge-ts

Streaming on rows as they are parsed

Has this been reconsidered? Looks like papaparse supports streaming, which might make the feature easier?

vallettea

comment created time in 2 months

starteddata-forge/data-forge-ts

started time in 2 months

startedpapercss/papercss

started time in 2 months

startedmicrosoft/language-server-protocol

started time in 2 months

issue commenttannerntannern/ts-mixer

Decorator deep inheritance not working

Thanks for reporting and for the code sample, that will make it quicker for me to test. I'll try to resolve this soon, but I do have a busy weekend so it may be a few days.

MigasEu

comment created time in 2 months

startedmmkal/ts

started time in 2 months

startedfacebookexperimental/Recoil

started time in 2 months

starteddohliam/dropin-minimal-css

started time in 2 months

startedfrappe/gantt

started time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 5ec11899012faa7909a29f987426719a26722e9f

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 5d7fb78b16cc89569d3d4728c1b634d8df6ccd29

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha fcd1b8127d9262e34f76aa5cb0dc170ed04e1627

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 87f3b32d0bc3c977f325cc73a142b34226e5a8d6

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha ea6f062450a22a4ca7f385b30eeeaafee2db8979

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha a88b543a1d19b284f8c48a237c77f72b59419e5d

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 8ec251289a05afe92e165ec78e1da0031797aab5

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha b6ac34a1b2144eeca4c3db41b95e7b97414a9a35

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 9ac708f6255ab2613926c3ddf1bcbcfb22f11cbf

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 9681c0599ba96a230fc9e6a3477a505986ab8753

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 14be222ca1601de383274b804b4b52feaee507cd

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 51218af7dc00a14cde6de107f75e201c923ec71f

Debugging

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha f3d740e2d197466e8666632f1afcd350da1aeed8

Made slack endpoints post as user (required oauth token)

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 4e7ab840d60c5600546ca62c3839b506e1d0a324

Fix slack handlers

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 1291e223ff9bce9d586ea53dbfc100bcfe16289a

Add basic slack endpoints

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 5830f478704cd199b6bac07d6fe8628c77982be8

Update README with examples

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 59694682b13f4ecaec77832ea995d1c9e8b30ddf

Vercel doesn't support null coalesce yet

view details

push time in 2 months

push eventtannerntannern/tiny-text-service

Tanner Nielsen

commit sha 170951f3c5192878f985caf13cbc682a2bf41f95

Implement conversion endpoints

view details

push time in 2 months

create barnchtannerntannern/tiny-text-service

branch : master

created branch time in 2 months

created repositorytannerntannern/tiny-text-service

Tiny text generator, as a service

created time in 2 months

issue closedtannerntannern/ts-mixer

Check if object's class has mixin

Is there a way to check if an object uses a certain mixin (its class is defined with that mixin)? My use case for example would be

        this.map.entities().forEach((entity) => {
            if (hasMixin(entity, Actor)) {
                const actor = entity as unknown as Actor;
                // use as Actor
            }
        });

I could work around this by checking if the object has a certain function, but I would prefer a more general solution (since this solution would be specific to the methods of each mixin)

closed time in 2 months

LemonPi

issue commenttannerntannern/ts-mixer

Check if object's class has mixin

Glad to hear it works well for you. 5.3.0 is live. Thanks for your interest in ts-mixer and helping improve the library!

LemonPi

comment created time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha c8bfc2d48854808755088332636e8d166007ed9f

feat: add hasMixin function (#27)

view details

Tanner Nielsen

commit sha 4689a66f87ea589a92d35fcf5cb942c5a01317f7

docs: add docs for hasMixin

view details

Tanner Nielsen

commit sha 78a938cf2e418101dd2472ae4edf1fbec3049dbd

chore(release): 5.3.0-beta.0

view details

Tanner Nielsen

commit sha c164295c95fa3c3749d6882c234e5535e5ca676a

chore: upgrade to TS 3.9 which required mix decorator type adjustment

view details

Tanner Nielsen

commit sha 0665b0711b73b1c83081c76e3150391a1e95ae07

ci: latest eslint parser seems broken on node 8

view details

Tanner Nielsen

commit sha 007b2df3291943a61fe4361cbc78b73ea950ec76

chore(release): 5.3.0

view details

push time in 2 months

created tagtannerntannern/ts-mixer

tagv5.3.0

A small TypeScript library that provides tolerable Mixin functionality.

created time in 2 months

delete branch tannerntannern/ts-mixer

delete branch : feature/has-mixin

delete time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha 0665b0711b73b1c83081c76e3150391a1e95ae07

ci: latest eslint parser seems broken on node 8

view details

push time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha 4ac91788f1604576bf0dd861354348d0af76d5ae

ci: latest eslint parser seems broken on node 8

view details

push time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha c164295c95fa3c3749d6882c234e5535e5ca676a

chore: upgrade to TS 3.9 which required mix decorator type adjustment

view details

push time in 2 months

issue commenttannerntannern/ts-mixer

Check if object's class has mixin

Well good news: you won't have to cast anymore because the hasMixin function already does the type narrowing for you. 5.3.0-beta.0 has been released, and you can try it out today with npm install ts-mixer@5.3.0-beta.0. The new README section covers it in more detail.

Let me know what you think! If you don't see any issues, I'll promote it to a full release.

Regarding your performance concern, my guess is that walking the prototype chain will be less intensive than checking for all properties, although I have not run the benchmarks to back this up. When you're working with mixins, prototype chains are often not very deep, but instead "wide", meaning the algorithm doesn't have to iterate very far to find what it's looking for. If someone has a very deep prototype chain with many layers of ts-mixer classes within, performance could suffer, but my guess is that it would be slight.

That being said, do let me know if you find the performance to be subpar, and I will see if I can improve my implementation.

LemonPi

comment created time in 2 months

created tagtannerntannern/ts-mixer

tagv5.3.0-beta.0

A small TypeScript library that provides tolerable Mixin functionality.

created time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha 78a938cf2e418101dd2472ae4edf1fbec3049dbd

chore(release): 5.3.0-beta.0

view details

push time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha 4689a66f87ea589a92d35fcf5cb942c5a01317f7

docs: add docs for hasMixin

view details

push time in 2 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha c8bfc2d48854808755088332636e8d166007ed9f

feat: add hasMixin function (#27)

view details

push time in 2 months

create barnchtannerntannern/ts-mixer

branch : feature/has-mixin

created branch time in 2 months

issue commenttannerntannern/ts-mixer

Check if object's class has mixin

This map solution you describe is exactly what I'm investigating at the moment. However, it is a little more complicated than just checking the mapped array, because the mixed class may be buried in the prototype chain, and the mixed class's constituents may also have mixed classes buried in their prototype chains.

LemonPi

comment created time in 2 months

issue commenttannerntannern/ts-mixer

Check if object's class has mixin

Hi @LemonPi, so I believe the functionality you're looking for is custom instanceof behavior, which is currently listed as a "non-feature" of ts-mixer. The primary reason for this is that in order to define this custom behavior, ts-mixer would have to modify the source classes, which I would really like to avoid.

However, I might be able to add a hasMixin function to ts-mixer as a replacement for instanceof. It could also use type guards so that -- to use your example -- the type of entity would automatically be inferred as Actor simply by using hasMixin in the if statement...

Let me do some digging and I'll get back to you. 🙂

LemonPi

comment created time in 2 months

startedxz/new.css

started time in 2 months

issue closedtannerntannern/ts-mixer

Sometimes is not visible Parent's protected functions to it's children

  • Sometimes is not visible Parent's protected functions to it's children: ...Working on reproduction...

closed time in 2 months

Judahh

issue commenttannerntannern/ts-mixer

Sometimes is not visible Parent's protected functions to it's children

Closing for now as I haven't gotten any more details about this issue.

Judahh

comment created time in 2 months

startedkrzkaczor/earl

started time in 2 months

issue closedtannerntannern/ts-mixer

Sometimes constructor does not see elements from default init function.

  • Sometimes constructor does not see elements from default init function.
class Class0 {
  public name;
}

abstract class ClassA {
  protected object0: Class0;
  protected name;
  protected test;

  init(test: string, object0?: Class0): void {
    this.name = this.constructor.name;
    this.test = test;
    this.object0 = object0 ? object0 : new Class0();
  }

  getName(): string {
    return this.name;
  }

  getTest(): string {
    return this.name;
  }
}

class ClassB extends ClassA {
  protected name1;
  init(test: string, object0?: Class0): void {
    super.init(test, object0);
    this.name1 = this.name + 1;
  }

  getName1(): string {
    return this.name1;
  }
}

const b = new ClassB('BB'); // Not possible

closed time in 3 months

Judahh

issue commenttannerntannern/ts-mixer

Sometimes constructor does not see elements from default init function.

Hi @Judahh, I haven't heard back I'm not seeing a connection to ts-mixer here. Please open another issue if you still think there's a ts-mixer-related issue here.

Judahh

comment created time in 3 months

startedNectarJS/nectarjs

started time in 3 months

startedlocalstack/awscli-local

started time in 3 months

issue commentbikeshaving/crank

tsconfig "reactNamespace" setting

Thanks for the detailed response. To your last point, having a default export would allow you to do this as well:

import Crank, { Context } from '@bikeshaving/crank';

With the import * as Crank method, you'd be forced to write two separate lines:

import * as Crank from '@bikeshaving/crank';
import { Context } from '@bikeshaving/crank';

Also

Maybe, but that would mean having to reexport every export in the Crank module a second time.

you shouldn't have to. I made myself a little wrapper module to achieve this import effect I'm after, which I think could translate to your code fairly easily.

export * from '@bikeshaving/crank';
import * as Crank from '@bikeshaving/crank';
export default Crank;

then in a component file...

import Crank, { Context } from './crank.ts';

Of course, it would be nice to not need this wrapper. 🙂

tannerntannern

comment created time in 3 months

issue openedbikeshaving/crank

tsconfig "reactNamespace" setting

Have you considered taking advantage of TypeScript's reactNamespace setting? If you add the following to your tsconfig,

"jsx": "react",
"reactNamespace": "Crank",

you can skip the /* @jsx createElement */ comments and instead do

import * as Crank from '@bikeshaving/crank';

If crank had an export default, you could write it even shorter, just as conveniently as React:

import Crank from '@bikeshaving/crank';

I think this should at least be mentioned in the TS docs. It reduces boilerplate (especially if you have lots of .tsx files) and might make React devs feel more at home. 🙂

Just giving you some food for thought. I love the idea behind this library!

created time in 3 months

issue closedtannerntannern/ts-mixer

class is wok, but if run with jest will throw error

import LRU from '../';

describe('clear() sets the cache to its initial state', () => {

	console.dir(LRU)

});
  ● Test suite failed to run

    TypeError: Object prototype may only be an Object or null: undefined
        at Function.create (<anonymous>)



      at Object.exports.hardMixProtos (node_modules/ts-mixer/dist/util.js:54:31)
      at Object.Mixin (node_modules/ts-mixer/dist/mixins.js:16:18)

closed time in 3 months

bluelovers

issue commenttannerntannern/ts-mixer

class is wok, but if run with jest will throw error

@bluelovers, I am unable to reproduce this issue. I used your code sample in my test suite and no errors were thrown. I was using mocha instead of jest, but the test framework shouldn't matter for an issue like this. I am closing the issue for now, but if you have clearer instructions on how to reproduce I'd be happy to help.

bluelovers

comment created time in 3 months

issue commenttannerntannern/ts-mixer

Sometimes is not visible Parent's protected functions to it's children

Hi @Judahh, any luck on reproducing this issue?

Judahh

comment created time in 3 months

issue commenttannerntannern/ts-mixer

Sometimes constructor does not see elements from default init function.

🤔 I'm failing to see how this relates to ts-mixer, as I don't see any usage of @mix or Mixin. Could you please clarify your issue?

Judahh

comment created time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha 3d3769b85a0086ec1ee8a4451378ddfe1ee95b08

Add more interactive UI

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha dcf2c863c2c471e45c867cb6fe736846ff7413bb

Fix missing dependency links

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha 033e620d45c3aa952fa83d8e1f949fd3912e64d8

Fix readme

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha ba58ffd2149240a02c2ec2571ea98fa74eb980b5

Use CRAN index which is faster and more reliable

view details

push time in 3 months

issue openedNREL/developer.nrel.gov

Wrong default `utc` value for psm3 data download API

I'm currently using the psm3 data download API, and it seems that these docs list the incorrect default value for the utc parameter.

For example, this is the URL I'm hitting: https://developer.nrel.gov/api/solar/nsrdb_psm3_download.csv?api_key=<key>&email=<email>&attributes=clearsky_ghi,solar_zenith_angle&interval=60&names=2014&wkt=POINT(-108.5449 48.5137)

When I omit the utc parameter, I get the same results as when I pass utc=false. And when I pass utc=true, I get different results. From this information it seems that false is the default, but the docs say the default is true. Which is correct?

created time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha 8944a999206ae9f3483912260a624eb6c22fdc71

Allow nodes to be in frontier even though they have already been added as a package. This allows all edge connections to be found.

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha 0e331e9f0899ad4ab061f5bc86a351cb10916be7

Add tips to readme

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha 08b033b9498e4a495b6f98a75b11294164c82224

Fix base url

view details

push time in 3 months

push eventtannerntannern/cran-visualizer

Tanner Nielsen

commit sha f589e4e2644077005c1ed7a71b592efe0bab89dc

Move dist to docs

view details

push time in 3 months

create barnchtannerntannern/cran-visualizer

branch : master

created branch time in 3 months

created repositorytannerntannern/cran-visualizer

Visualize R dependency trees

created time in 3 months

issue commenttannerntannern/ts-mixer

Sometimes is not visible Parent's protected functions to it's children

Hi @Judahh, these sound like separate problems to me, so probably best to have a separate github issue for each. But either way I will need more details to reproduce.

Judahh

comment created time in 3 months

issue closedtannerntannern/ts-mixer

Mix decorator is not copying the base class name

First of all, I would like to congratz you for your useful package.

But I have a suggestion or maybe a bug fix, depending on whether it's a design or not xD I have been using the mix decorator in some classes for about 1 month and it's a bit confusing having all of them with the same name (MixedClass) as it's showed in the picture. Just copying the property constructor.name in the class returned by the decorator would solve this issue.

MixedClass issue

Best regards,

closed time in 3 months

bfbechlin

issue commenttannerntannern/ts-mixer

Mix decorator is not copying the base class name

Fixed in 5.2.1

bfbechlin

comment created time in 3 months

created tagtannerntannern/ts-mixer

tagv5.2.1

A small TypeScript library that provides tolerable Mixin functionality.

created time in 3 months

push eventtannerntannern/ts-mixer

Tanner Nielsen

commit sha 95f6c4ce413712785ff43aa0da0bfac258ad9c65

chore: update dependencies

view details

Tanner Nielsen

commit sha 7274fa26a68e05cc59cde1108610e6a1ab51b430

fix: mix decorator not preserving constructor name

view details

Tanner Nielsen

commit sha b3a72d30d3d3a85d041cdc82f1a84ca532e5ca7c

chore(release): 5.2.1

view details

push time in 3 months

delete branch tannerntannern/ts-mixer

delete branch : gh-issue-24

delete time in 3 months

create barnchtannerntannern/ts-mixer

branch : gh-issue-24

created branch time in 3 months

issue commenttannerntannern/ts-mixer

Mix decorator is not copying the base class name

Great idea! This should be relatively simple to implement if you wanted to open a PR. Otherwise I will take a closer look at this tomorrow.

bfbechlin

comment created time in 3 months

more