Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where property directive compiled without errors on a regular page #1639

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acizmarik
Copy link
Member

This PR fixes an issue where @property ... directive compiles just fine in a regular page. This feature is meant to be within markup controls only

{
return new ResolvedTypeDescriptor(typeof(DotvvmMarkupControl));
}
=> new ResolvedTypeDescriptor(IsMarkupControl() ? typeof(DotvvmMarkupControl) : typeof(DotvvmView));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Determining the wrapper type based on file extension is fragile. Now everything worked even when the base type was incorrectly inferred as DotvvmView (#1479), so people can use dothtml or html extension for controls. I think it would be better to determine if a page is control based on the registration in dotvvm configuration:

configuration.Markup.Controls.Any(c => fileName.Equals(c.Src, StringComparison.OrdinalIgnoreCase))

However, that would run into problem every time a new control is added in VS Extension, so I'd use an "extension OR configuration" condition in there (this class is overwritten anyway, so if this method is abstract it should be easy, right?)

@tomasherceg tomasherceg added this to the Version 5.0 milestone Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants