Comments (13)
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.
There's a mixin solution for this: https://github.com/okwolf/hyperapp-freeze
from hyperapp.
@charlike yes @jbucaran is correct, hyperapp-freeze
will get cleaned up after the hyperapp-logger
refactor is complete.
from hyperapp.
@tunnckoCore What's the advantage?
from hyperapp.
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.
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.
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.
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.
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.
@tunnckoCore Feel like we can close this?
from hyperapp.
yea, it is clear :)
from hyperapp.
@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.
@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)
- A way to insert raw Html HOT 1
- TypeError: can't access property 0, newSubs is null, when setting the state to undefined. HOT 4
- Issue with null-vnodes HOT 1
- prevent rerender node HOT 2
- The dispatch initializer ends in an endless loop on init when dispatching any action HOT 7
- Injected classes gets removed when using object/array to define class props HOT 1
- hyperapp version HOT 3
- Memo Data Gotcha HOT 5
- Confusing doc for actions -> wrapped actions HOT 5
- Passing arguments to init HOT 4
- [Question] Headless mode is still possible? HOT 1
- Destroying a child app HOT 8
- @hyperapp/html: use a Proxy? HOT 9
- Actions returning other Actions HOT 5
- Compile template tag to hyperscript HOT 17
- A challenge to hyperapp community HOT 1
- Has 2.0 been dropped from development? HOT 3
- oldSub[2] is not a function HOT 3
- Cannot read properties of null (reading 'length') HOT 5
- Unlikely Use Case bug in HTML and SVG Packages HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperapp.