by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 08 23:55
    koresar commented #352
  • Jun 05 16:15
    PopGoesTheWza commented #352
  • Jun 04 22:34
    koresar commented #352
  • Jun 04 17:30
    jdittrich commented #352
  • Jun 04 01:28
    basejump commented #351
  • Jun 03 11:26
    jdittrich commented #352
  • Jun 02 22:19
    koresar commented #352
  • Jun 02 22:19
    koresar commented #352
  • Jun 02 17:30
    jdittrich commented #352
  • Jun 02 03:42
    koresar commented #352
  • Jun 01 18:11
    jdittrich opened #352
  • May 31 11:14
    koresar closed #351
  • May 31 11:14
    koresar commented #351
  • May 31 08:55
    koresar commented #351
  • May 30 20:39
    basejump opened #351
  • Feb 17 06:11

    koresar on master

    README refresh: remove bower, u… (compare)

  • Dec 04 2019 23:32
    koresar commented #348
  • Dec 04 2019 23:14

    koresar on master

    Simplify one of the build scrip… (compare)

  • Dec 04 2019 23:01

    koresar on v4.3.1

    (compare)

  • Dec 04 2019 23:01

    koresar on master

    4.3.1 (compare)

Ivan V.
@ivandotv
is it published? under what name?
Vasyl Boroviak
@koresar
3 months ago we released the built in support of JS getters and setters
@FredyC the development never stopped.
Ivan V.
@ivandotv
I see it's included in the package, but what should I use stampit or @stamp/it?
Vasyl Boroviak
@koresar
First one is universal, but mainly built for Frontends
Second one is a clone which is going to be rewritten in the most modern way with TypeScript
Ivan V.
@ivandotv
I'm looking to use the same code on both frontend and backend
Vasyl Boroviak
@koresar
Both will work either side
Ivan V.
@ivandotv
What do you recommend? starting from scratch.
Vasyl Boroviak
@koresar
Although, I recommend "stampit" because it's tiny in size and is compatible with all things "@stamp/..."
I think I forgot to publish v4.3.1 with the new types file. Oops
Ivan V.
@ivandotv
I've tried using the stampit library on codesandbox and it wasn't working (4.3.0) and @stamp/it 1.1.0
Vasyl Boroviak
@koresar
You stampit?
I have no idea what is "stamp" library
Ivan V.
@ivandotv
Yeah I meant stampit
Vasyl Boroviak
@koresar
If you have more details on what is "wasn't working" it would be great. Imagine still learning to read minds.
😂
Imagine =I'm
Ivan V.
@ivandotv
I will try the library tommorrow in TS , and I'll get back to you
Vasyl Boroviak
@koresar
👍
Ivan V.
@ivandotv
Any performance concerns about the library?
Do you have any experience with mobx5? It uses proxies to do its magic
Will the usage of proxies be a problem?
Vasyl Boroviak
@koresar
If you are going to create millions of objects per second then it will be slow. But if less than that - you're good.
Probably proxies are not an issue
Ivan V.
@ivandotv
I will try to mix the two libraries together and I'll report back here.
thanks for the hard work.
Vasyl Boroviak
@koresar
Because stampit generates regular plain text objects.
Thank you very much. I appreciate
Vasyl Boroviak
@koresar
stampit v4.3.1 with improved TypeScript support was just published
https://github.com/stampit-org/stampit/tree/v4.3.1
Ivan V.
@ivandotv
great, I will test it as soon as I get some free time
Vasyl Boroviak
@koresar
Thanks for reminding me to publish it
Daniel K.
@FredyC
@koresar thanks for heads up, that is great to hear there is such progress, now I am torn apart
lately, I started discovering XState for writing business logic, it's about state machines
it's essentially another way of composition with nice vizualizer
need to think if stamps can fit somewhere in there :)
Vasyl Boroviak
@koresar
Just googled it. Wow
Ivan V.
@ivandotv
I have just tried the 4.3.1 version.
and there is no type hinting for derived objects (used the example from the readme)
import stampit from 'stampit'

const Character = stampit({
  props: {
    name: null,
    health: 100
  },
  init({ name = this.name }) {
    this.name = name
  }
})

const Fighter = stampit(Character, { // inheriting
  props: {
    stamina: 100
  },
  init({ stamina = this.stamina }) {
    this.stamina = stamina;    
  },
  methods: {
    fight() {
      console.log(`${this.name} takes a mighty swing!`)
      this.stamina--
    }
  }
})

const fighter = Fighter({ name: 'Thumper' }) // does not know about arguments that are needed
fighter.fight() // does not know about the "fight" method or method arguments
Vasyl Boroviak
@koresar
Mate, if you know how to fix it could you tell us please?
Ivan V.
@ivandotv
Since stampit is a very small library easier thing would be to just rewrite it in typescript than to create .d.ts files by hand. I'll will take a look at the library maybe over the weekend.
Vasyl Boroviak
@koresar
True.
The only reason I see JS is better is performance. And library size.
Currently it's 1.4 kb gripped. But that's not as important. But we have performance unit tests. These better not be broken.
Daniel K.
@FredyC
@koresar do you have some measurement that TS compiled code is somehow slower than the one you write directly in ES5? not sure about size, but I wouldn't expect much of increase
Vasyl Boroviak
@koresar
I doubt TS compiled code will be slower. It's just a reminder that we have perf tests which should pass. That's all
Duane Johnson
@canadaduane
Is there a way to inspect a stamp in the javascript console? e.g. when I create a stamp with const e = stampit(...) and then console.log(e) I get output "function t(r)" in firefox (using parceljs). If I click the down-arrow next to "function t(r)" I can see a few of its properties, but it is intermingled with a lot of stamp-specific functions.
Duane Johnson
@canadaduane
Ah, I see. A stamp comes with all of its functions, but an "instance" is clean. I can live with that.
Vasyl Boroviak
@koresar
@canadaduane well done :)
This page might help a little: https://stampit.js.org/ (scroll down)
Duane Johnson
@canadaduane
Thanks @koresar
BTW I think I've found a bug in the Collision add-on: it seems that in conjunction with get/set style methods, the Collision code calls the methods instead of introspecting.
Duane Johnson
@canadaduane
Issue added here: stampit-org/stamp#79
Duane Johnson
@canadaduane
The documentation server appears to be down: https://stampit.js.org/
Error 1014 Ray ID: 59bc353ec8fc025a • 2020-05-30 23:24:19 UTC
CNAME Cross-User Banned