Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 28 09:35
    sammys edited #356
  • Oct 27 00:59
    sammys edited #356
  • Oct 27 00:57
    sammys commented #356
  • Oct 27 00:55
    sammys commented #356
  • Oct 27 00:48
    sammys edited #356
  • Oct 27 00:36
    sammys commented #356
  • Oct 26 09:47
    koresar commented #356
  • Oct 25 07:06
    sammys opened #356
  • Apr 05 08:09
    StephaneTy-Pro commented #341
  • Feb 10 12:29
    koresar commented #355
  • Feb 09 15:47
    minjiewang29 closed #355
  • Feb 09 00:40
    minjiewang29 edited #355
  • Feb 09 00:40
    minjiewang29 opened #355
  • May 04 2021 07:40
    PopGoesTheWza commented #354
  • May 04 2021 03:42
    KookiKodes commented #354
  • May 04 2021 02:25
    sammys commented #354
  • May 04 2021 01:51
    koresar commented #354
  • May 03 2021 04:26
    KookiKodes edited #354
  • May 03 2021 03:58
    KookiKodes opened #354
  • Apr 01 2021 11:10

    koresar on master

    5 bytes smaller min.gz (compare)

Ivan Vlatković
@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 Vlatković
@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 Vlatković
@ivandotv
I'm looking to use the same code on both frontend and backend
Vasyl Boroviak
@koresar
Both will work either side
Ivan Vlatković
@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 Vlatković
@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 Vlatković
@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 Vlatković
@ivandotv
I will try the library tommorrow in TS , and I'll get back to you
Vasyl Boroviak
@koresar
👍
Ivan Vlatković
@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 Vlatković
@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 Vlatković
@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 Vlatković
@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 Vlatković
@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