Replies: 4 comments 3 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
If we freeze the list, it would kinda mark mojo.js as the more actively maintained framework. Since it would still be able to add new rendering features freely, while Mojolicious could not anymore. I don't think that's a good idea. |
Beta Was this translation helpful? Give feedback.
-
Freezing the set of top-level reserved words in the stash that could clash with user keys/variables does not necessarily mean freezing rendering features tout-court. How about rule that all future reserved keywords in stash will start with a hyphen, or some other prefix that users are not allowed to use, much like what happens with |
Beta Was this translation helpful? Give feedback.
-
Let's take this from the other side. Is there a recommended practice to choose a stash variable name such that there will be no clashes in the future? Like start with an uppercase because reserved words will never contain uppercase letters, or end with an underscore, or some other common sense rule that can be adopted without limiting future evolutions? |
Beta Was this translation helpful? Give feedback.
-
As of version 9.22, the docs for method
stash
have this:Currently is scary: it opens the door to any other word to be included in the list in the future, potentially breaking backwards compatibility for applications.
As I understand from some comments in #1889, the list should be stable at this point, because Mojolicious is pretty mature. So adding a new reserved word would be a quite rare event, but still possible as implied by the docs.
If the
mojo.*
sub-namespace can be used for future extensions to the list, I think it's fair to freeze the list of reserved words leaving the note aboutmojo.*
. Otherwise, ifmojo.*
is really internal, I would propose to allocate a similar prefix for these extensions and add it to the list of reserved words, then freeze that list.All in all, my suggestion is to freeze the list of reserved words and get rid of the currently in a way or another.
Beta Was this translation helpful? Give feedback.
All reactions