Code Monkey home page Code Monkey logo

Comments (13)

jorgebucaran avatar jorgebucaran commented on April 27, 2024 1

Thanks for supporting Hyperapp, I like it too ;) but let's not derail this thread or any other to criticize choo. choo was a big source of inspiration for me.

With regards to the issue at hand, I have nothing against object.freeze, but I don't know if it is worth introducing in core.

from hyperapp.

okwolf avatar okwolf commented on April 27, 2024 1

There's a mixin solution for this: https://github.com/okwolf/hyperapp-freeze

from hyperapp.

okwolf avatar okwolf commented on April 27, 2024 1

@charlike yes @jbucaran is correct, hyperapp-freeze will get cleaned up after the hyperapp-logger refactor is complete.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

@tunnckoCore What's the advantage?

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

what you think about the model to be object

choo does this IIRC. HyperApp is more flexible allowing the model to be a string, number, array or object.

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

choo does this IIRC

That's why I'm asking. I think it is immutable for reason. And that isn't only in choo, actually. "immutable" and "functional" are kinda trending these days.

I'm not so frontend, but I like that and I believe that's good and correct trend.

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

Can you freeze a number or an array or is it limited to objects?

What about simply not changing the model? The only reason you'd want to freeze the model is to avoid mutations, but you can also avoid this by not mutating the model yourself.

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

Can you freeze a number or an array or is it limited to objects?

No. In ES2015 it will return it, in below versions it will throw TypeError.

What about simply not changing the model?

For same reason that most devs use flow/typescript - guarantees, I kinda still don't like them, as I don't like the native assert and massive usage of it then "unassertifyfyfyfyfyf" (like Yosh and browserify & co devs does and promotes).

offtopic / 2c

edit: I'm strongly against that massive usage of assert and then unassertify "for production", because it drives you directly to the hell - unexpected errors, throws, awful stacktraces and etc.

edit2: Actually, that's the biggest reason that I don't like and don't use choo and won't use anything from that part of the community.

edit3: And that's the reason why I like hyperapp and that it is really 1-2kb with everything, not like choo which is "5kb", but browserify-ied (big bundles) and unassertify-ied (bad prod. experience)

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

but let's not derail this thread or any other to criticize choo. choo was a big source of inspiration for HyperApp.

Yea, it is great in anyway, I just sharing my view points. :)

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

@tunnckoCore Feel like we can close this?

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

yea, it is clear :)

from hyperapp.

tunnckoCore avatar tunnckoCore commented on April 27, 2024

@okwolf that's cool idea, but any reasonable and logical reason to hardcode the deep-freeze package instead of including it as normally and expose cjs, es and umd bundles (with rollup for example, it's pretty easy)?

from hyperapp.

jorgebucaran avatar jorgebucaran commented on April 27, 2024

@charlike Yeah, I think he was in a hurry.

@okwolf This should be good to get you started.

Same cosmetic changes apply to hyperapp-freeze, etc. 👋

from hyperapp.

Related Issues (20)

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.