Skip to content

Please add support for constants for @page directive #54126

@macias

Description

@macias

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

If you pick good book, or talk to somebody with a bit experience you will hear to not use magic symbols, like peppering your code with "44.5", instead you should define constant "DefaultSizeShoe" and then use this constant instead.

Yet, for some time @page supports only literal, not a symbol constant.

Describe the solution you'd like

Please support constants for @page, so one could write:

@page MyConstants.Counter

Additional context

There is interesting history for this request, because it was asked again and again, like here:

#15977

if it becomes a common feature request we'll certainly consider it

And the request is closed (it is not possible to upvote it or comment). So I wonder how on Earth we can make it "common feature request" if you disable any interaction.

2 years later:

#23195

you can achieve this by using @Attribute [Route(Constants.PageRoute)] instead of @page and everything else should be the same.

Yes it works, but discoverability is... super low. Besides, if we humans have to replace one code for another, why computer cannot do this?

Bottom line is, if for any reason this feature is not possible for now, please, pretty please, leave it open, so other can read, comment, upvote, etc. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions