Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

HTML and CSS instead of XAML or as addition #290

Closed
mrNo0b opened this issue Dec 21, 2020 · 16 comments
Closed

HTML and CSS instead of XAML or as addition #290

mrNo0b opened this issue Dec 21, 2020 · 16 comments

Comments

@mrNo0b
Copy link

mrNo0b commented Dec 21, 2020

As far as I know MAUI will use xaml, why not make it use html and css instead? or allow selecting html and css or xaml?

#DeliverUsFromXAML

@redradist
Copy link

redradist commented Dec 22, 2020

As far as I know MAUI will use xaml, why not make it use html and css instead? or allow selecting html and css or xaml?

#DeliverUsFromXAML

@mrNo0b It will provide ability to choose between xaml and html based solution

xaml solution will be based on work done in Xamarin and this repository
html solution will be based on work done by Balzor Web App and Blazor Mobile Bindings

@REscobar
Copy link

Note that XAML is a serialization (marshalling) language, that is, you represent instances of objects using an alternate representation that gets (eventually) compiled to IL, while Html is a markup language that represents documents, not instances of objects.

Html works very well in the browser because it has an html interpreter and rendering engine
It is be possible to implement one for MAUI, but it is not as simple as just implementing another language to author the UI.

@mrNo0b mrNo0b closed this as completed Dec 23, 2020
@mrNo0b mrNo0b reopened this Dec 23, 2020
@mrNo0b
Copy link
Author

mrNo0b commented Dec 23, 2020

What I am trying to say is that the UI code will be similar to html and style will be similar to css but will have all the wpf features, so instead of writing 200 lines on xaml control template where actual style only take 30 lines we will have css style with additional wpf specific stuff.
people defend xaml like their life depends on it, its time to move on and make devs lifes easier. xaml was made once from scratch some time ago, now MAUI can become the next thing instead of dragging xaml into it.

@doterik
Copy link

doterik commented Dec 23, 2020

I sincerely hope that I've got this right, MAUI is supposed to replace xaml so that I nevermore have to lay my eyes on xaml again.

@GeraudFabien
Copy link

GeraudFabien commented Dec 23, 2020

@doterik no MAUI is just a port of Xamarin to .Net 6 (instead of mono). And since there will be some breaking change they allow some breaking change.

why not make it use html and css instead?

Because we prefer XAML.
Because it 's already exist (blazor).
Because Xaml is different thant just HTML+CSS.
Beacuse there is a lot of application using XAML.

UI code will be similar to html

Xaml is similar to HTML in some ways

so instead of writing 200 lines on xaml control template where actual style only take 30 lines we will have css style with additional wpf specific stuff.

There is never that much difference in loc count. Even when i have to remake the full template to add a placeholder... And it's where HTML is better. The main case where the gap in loc is huge is when using bootstrap or anythinks like it. But all XAML framework also have bootstrap...

people defend xaml like their life depends on it

Both have they're poor and cons. XAML is way more powerful if you want to customize. But HTML/CSS is old and have a lot of tooling and trick to pass any limitation.

@doterik
Copy link

doterik commented Dec 23, 2020

@GeraudFabien Thanks for your input. I'm confused, maybe I mixed it with Comet, or I'm completely wrong. Code instead of XAML is my hope for the future.

@realtebo
Copy link

I hate xml
I love declarative UI but I also hate flutter style of too nested code that creates the indentation hell

but I thinks ms will not leave out xml and xaml. Old school rules in big company

@GeraudFabien
Copy link

I hate xml

There is a lot of reason why you could hate XML can you elaborate please. Mine as example :

  • They create a black box between the code and the UI
  • The facts it's a separate language with totally different rules. Mean a totaly different way of thinking's also sometime it's compile into the language or you have to consume directly. You hit regularly some useless limitation or technical complexity that has no logical sense.
  • They do not propose the feature of the language by default (breakpoint, reload, performance tools, ...)

But there is also some advantage XML is a complete markup language. It's realy clear and easy to create simple and complex object and to set simple or complex property. The language is also extensible... That why XML was chosen instead of YAML or JSON. The fact it's a different language enable feature like "Duck Typing", ... to be add without being weird.

You may want to read microsoft/xaml-standard#73.

@Cfun1
Copy link

Cfun1 commented Jan 9, 2021

I believe a lot of developers and companies relay on xamain forms which means on xaml, also developers who used to work with wpf are familiar with xaml so a transition to Xamarin will be smooth. But in this domaine not all are familiar with html+css.

In addition IMHO bringing something like this will cost a lot of effort time and money, will bring it own issues and at the end the gain is little. It would be considered as not worthed when you already have something very powerful and as solid and stable as xaml and contiously improving espcially for the hot reload, errors reporting. (not to forget the c# markup).

@mrNo0b
Copy link
Author

mrNo0b commented Jan 10, 2021

They can continue relay on Xamarin etc. they probably also still use VB6 or win forms. its time for a change and not another "update", new frameworks appear everyday and developers learn and use them, so if Microsoft can make something new and good I am pretty sure devs will learn it. and if it will finally be truly cross platform it will be probably the only framework devs will need.
All those companies actually drag everyone down when they refuse to spend some money to update their 20+ year old product and instead force developers to use old frameworks etc. it should be the other way around, companies should be the one who adapt to the changes, the world doesn't revolve around them as they used to believe... If they don't adapt they go out business. that is how everything works IDK why it should be any different with software dev. if all the resources that spent creating backwards compatible stuff would go instead to actually moving forward we will have happy life.

@mrwcjoughin
Copy link

mrwcjoughin commented Jan 10, 2021 via email

@LukeTOBrien
Copy link

"finally cross platform"?

I think they mean .NET is finally cross platform - From what I understand Xamarin uses Mono - So I think MAUI is redesigning Xamarin to use .NET instead of Mono.

I have followed the history of Xamarin for many years - And I think they still own my a monkey for completing a survey they had when their website was still under construction in the pre-Microsoft days.

@mrwcjoughin
Copy link

mrwcjoughin commented Jan 20, 2021 via email

@saint4eva
Copy link

"finally cross platform"?

I think they mean .NET is finally cross platform - From what I understand Xamarin uses Mono - So I think MAUI is redesigning Xamarin to use .NET instead of Mono.

I have followed the history of Xamarin for many years - And I think they still own my a monkey for completing a survey they had when their website was still under construction in the pre-Microsoft days.

Yes, the same BCL, but different runtimes.

@yariker
Copy link

yariker commented Jan 29, 2021

HTML and XAML are both based on SGML, so they essentially share the same grammar. Moreover, you can almost look at XAML as an extension of HTML with some handy additions such as property element syntax (expanding an attribute into a subelement) and markup extensions. And if you start adding things to HTML to make it less static such as property binding from Angular, you end up in a circle reinventing XAML.

So I think what you really want to ask is can we make use of CSS in MAUI (already partially supported by Xamarin.Forms but more like a gimmick), then this would be a highly debated topic. CSS has its own history of problems that spawned a ton of internet memes, with various people trying to "fix" it such as Less, Saas, Stylus, and so on.

Perhaps what is actually worth discussing is how can we improve XAML and move it forward, such as getting rid of XML namespaces (there was a talk of making XML documents "namespace aware" by default back in the time of XML 2.0 discussions), improving the markup extension syntax (allow more C#-like constructs in bindings), etc.

@PureWeen PureWeen closed this as completed Feb 1, 2021
@dotnet dotnet locked and limited conversation to collaborators Feb 1, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests