A Proposal for Customizable Framework Fields and Improved Developer Control #3001
Closed
kachurunus
started this conversation in
General
Replies: 2 comments
-
I can perform all the necessary refactoring and submit a PR if I get the green light from you @GianlucaGuarini |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your patch. Now custom 3rd party scripts accessing the Riot.js internals should get a bit more freedom 💪 Have fun and happy coding! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Facing this issue (#2999), I was reminded of another problem I have. My issue is that I don't require the
this.state
andthis.props
fields provided by Riot. I create my own and manage them independently (in my case, I use MobX and need these fields to beobservable
). I see no reason why Riot doesn't allow configuring these variables. Likewise, I'm puzzled as to who decided thatDOM_COMPONENT_INSTANCE_PROPERTY
andPARENT_KEY_SYMBOL
might be needed by some external tool, but not the other fields.I'm convinced that it would be much better to slightly modify Riot's source code so that instead of:
the code would look like this:
This change wouldn't break anything, while allowing developers who use Riot to configure the Riot fields as needed before registering components, thus gaining more comprehensive control at the framework level (especially relevant when writing plugins).
Specifically, I would do the following (using props as an example):
I'm already doing this, but it's much more complicated and essentially a battle with Riot. Implementing something similar with
state
is simply IMPOSSIBLE (although I can't remember why, maybe it was something in old versions like 5.x), forcing me to maintain my own version of Riot just to rename a field value (no, I cannot just avoid using the word 'state' for the state; that would be absurd).Beta Was this translation helpful? Give feedback.
All reactions