Do we want to use @code instead of @functions?
also, could we move them (by convention) to before instead of after the html? :)
pure bikeshed, but i鈥檝e been writing everything that way because it feels like the C# bits are the lower layer - you write those and then you reference them from the markup. it would also be more familiar to people coming from React because it鈥檚 akin to a render function which returns JSX.
@gulbanana also, could we move them (by convention) to before instead of after the html? I don't get this sentence?
Do you mean you would want functions/code block to be moved before HTML in dotnet/visual studio templates? Or do you think you can't move functions/code block before HTML? Because if it's that then just move your functions/code block before HTML, it works just fine.
@rynowak I don't know much about VB but isn't @Code already used in Visual Basic code blocks for Razor? Does @code cause any conflicts wit h it?
yeah, i was thinking about templates and docs - i already handwrite stuff that way, with [Parameter]s and then the markup that uses them
obviously it's incredibly unimportant where they go but this seems like the right time to make unimportant aesthetic decisions!
@gulbanana This is not a community forum so you should create another issue for that and not hijack this unrelated issue.
it's literally the issue for reviewing the design of the directive
@gulbanana no it's not. What you are describing already works. Your issue is about default templates Microsoft provides.
I agree "functions" is not a very good name. I don't know about "code" as html/js in the template is code as well and this is one of the most generic term out there : a google search for "blazor code error" would give results about vscode, or any code related to blazor. Maybe something that means that it's the definition of the class or the component behavior ("behavior" would be nice or "logic").
Why not do the same that aspnet Razor Pages with a nested page .csrazor to differentiate the HTML from code?
We're going to enable that as well. We still want to try and make things better overall 馃槃
@code makes more sense to me.
Most helpful comment
Why not do the same that aspnet Razor Pages with a nested page .csrazor to differentiate the HTML from code?