chanan / BlazorStrap

Bootstrap 4 Components for Blazor Framework
https://blazorstrap.io
The Unlicense
917 stars 157 forks source link

BlazorStrap is TOO Obtrusive/Intrusive #196

Closed herbertmilhomme closed 4 years ago

herbertmilhomme commented 4 years ago

I modified my html and layouts exactly like how I wanted it, and "expected" blazorstrap to only incorporate "functions" and "services." But instead, what i got is MY bootstrap.js/.css double loaded on webpage out of order, and in places it shouldnt be, with versions i'm not even asking for.

Is it possible to create blazorstrap as a c# extension/framework/utility, and let it ONLY add features, and instead allow US the users, to manually modify our OWN index.html to be designed manually? There's no reason that it's necessary to have it "automated" in any way. bootstrap is essentially like 2 or 3 files (.css and one or two .js). As per bootstrap instructions, 1. go to website, 2. download files, 3. add tag/references line to html. We dont need to have codes modifying and changing around a process without a way to turn it on/off. 'Cause it's screwing up results for me. My old MVC projects look different in Blazor/.NET3.0, all because i wanted to use [only] Razor Components to shortcut a few tedious steps in my design (backend+javascript) process.

Resuts: MVC

Blazor

Note broken grids/columns, extra wide container padding, and additional javascript inserted in <head> (adds fluff to page load time as well. It's recommended to have javascript elements loaded at bottom of html, as it queues up the loading process of other elements). Everything SHOULD be the same, as i copied html one for one, from mvc to blazor. YET! They appear radically different. Only blazor different right now, is i replaced <div:modal> with <BSModal>, and i'm having troubles getting it to pop-up on command and clicking nav-href links doesnt scroll to element, but instead jumps page top (regardless of which nav is clicked).

Also... blazorstrap.js shouldnt be REMOVING functions from user projects.. it's way too invasive.

modelEscape: function () {
        document.body.onkeydown = function (e) {
            if (e.key == "Escape") {
                document.body.onkeydown = null; //this line alone can potentially break a LOT of projects; causes users to be to reliant on decision of one over another
                DotNet.invokeMethodAsync("BlazorStrap", "OnEscape");
            }
        };
    },

Is it necessary to replace original bootstrap.js, instead of just writing things to load and rely on aria-...? All of bootstrap uses and relies on aria- attributes, and here we are with blazorstrap, and not a single use of it implements that anywhere in it's design. I'm confused on how i'm supposed to overlay, and integrate. I feel like i have to make choices in how i create things between using one over another, and instead of writing things based on documentation i'm already familiar with (traditional media, with years of history)... i have to reinvent everything i know, because you guys decide to "mix things up" and change how tools [would/should] normally behave.

How do i remove modification to my index.html file from BlazorStrap inheritance?

TLDR; I feel like instead adding additional "support" and quick integration/shortcuts for popular utility (i.e. Bootstrap), by increasing flexibility/potential of automating heavy lifting, the project has been designed around the intentions of replacing bootstrap entirely by redoing over bootstrap.js and internalizing it into a Blazor (C#/.razor) nuget package, for .NET. (Though nothing wrong with that, i just feel like the direction wasn't properly expressed like that when introduced to the utility, and i think it hurts more than helps).

herbertmilhomme commented 4 years ago

I resolved the modal pop-up error, but everything else still stands... (was user error on the modal not popping-up. i had used a manual override command to force pop-up while also having the auto trigger written in. They're not allowed to both be in-use, so i removed one and it's functional again).

jbomhold3 commented 4 years ago

Blazor does not write directly to the dom. It uses difs. When you make changes directly to the dom. Blazor does not track them. Could some elements work better by just the js file. Absolutely until you need to open a ig modal in code. Now your adding more javascript interop calls to handle something a book call do on it's own. I don't support the idea of bringing in the bootstrap.js. The entire point of BlazorStrap is to give a C# version of bootstrap. Somethings are impossible atm so javascript is used in rare cases.

Styling. @chanan can speak to blazor style more thats his baby. Off the top of my head you should be able to remove the service to get ride of the auto imports. Giving you full control of your index.html. if not, it's something that will be addresses in the next release.

Lastly "... i have to reinvent everything i know, because you guys decide to "mix things up" and change how tools [would/should] normally behave." We volunteer our time on this project. We don't have a donation button, ads or get gifts. Nor are we forcing anyone to use our product. And while we understand things can be frustrating. When they do not work the way you expect them too. All it takes is a open dialogue and we are more then happy to address short comings. As long as they fit into the scope of our vision for the project.

Thank you for your feedback and my and chanan will have a meeting to talk in detail about each point brought up here.

herbertmilhomme commented 4 years ago

Hey @jbomhold3, thanks for your response and clarity. I guess by last part i may have overstepped and crossed a line, and should apologize to some degree for my harsh/bold words. If anything, please read the TLDR of my initial post, as i tried to rephrase core message of my post. Which probably wasnt there at the time you decided to reply. (I made a lot of edits to original post, as having a lot to say makes it hard to make sure it's all said well the first time you say it).

"All it takes is a open dialogue..."
I 100% agree, which is why probably why i had so many questions about what's going on and how things are being done.

"... i have to reinvent everything i know, because you guys decide to "mix things up" and change how tools [would/should] normally behave."
Is a remark more towards project direction, less this is a product i'm entitled to. I thought it was a fair statement that could be made about anything, as it's a very generic and straightforward thought. You guys are engineering something unique and new, and are ahead of the trend by offering a service and utility that doesnt exist yet (or maybe it does). I assumed that since you guys were taking inspiration and emulating something that already exist, you would build on top of it, as a brick in fundamental or integral key to everyone's arsenal. (Instead of "mixing things up" -- asking users to drive on opposite side of road and eat with your less dominant hand... none of which are requirements as driving is a privilege and hand you use is a choice. Even changing meaning of words we use in everyday language/idioms could be another analogy i could've lead with).

"I don't support the idea of bringing in the bootstrap.js."
I just want to be clear, i dont support it either... i just figured if anyone wanted any javascript they would go out of their way to fetch it themselves, and put it in... just like another other feature or function they desired. My feelings are on "The entire point of BlazorStrap is to give a C# version of bootstrap"; where instead of using/relying/supporting it (bootstrap.js)... the plan is to rewrite/replace it. Which i fail to see why that's a better decision than the one i have been suggesting/assuming.

But for sure, definitely thank you for project and your hard work. You're definitely correct... "We volunteer our time on this project. We don't have a donation button, ads or get gifts. Nor are we forcing anyone to use our product." I am definitely a fan and am proud to be using your services. I just feel that it's unfortunate that i may be faced with tough decision of going under hood of something i really admired just to strip out and redo things as it jeopardizes compatibility and ostracize me from rest of project.

chucker commented 4 years ago

@herbertmilhomme keep in mind that JS interop is:

1) slow. Moving data back and forth between JS and C# a lot therefore isn't a great idea, and should be avoided in a relatively dependency like BlazorStrap where possible.

2) unavoidable to manipulate the DOM. If something can't be solved simply by emitting different markup within the component (before that markup becomes part of the DOM), and/or applying CSS, JS is required, because WebAssembly doesn't yet have any access to the browser's DOM whatsoever.

Thus, a library like BlazorStrap is bound to have little bits of JavaScript sprinkled in here and there to support features like tooltips, yet avoid doing too much of it in there.

(And, as @jbomhold3 already said, avoiding JS is kind of the whole point. If you want a JS-based SPA framework, those do exist. Where Blazor shines is in giving you C# + Razor.)

herbertmilhomme commented 4 years ago

I feel like what i'm saying and what you guys (both @jbomhold3 and @chucker) are saying are not relevant or related to each other (my concerns and your response). Miscommunication is pretty heavy, and i have no idea how to piece the two together. So instead of inciting a heated discussion/argument, i will concede to whatever it is you guys are saying (even though i have no clue what it is you're saying) and just back out of topic. Thank you :)

jbomhold3 commented 4 years ago

@herbertmilhomme There are good things brought up here and as I said we will have a talk about them. I don't want you leaving here feeling like the entire conversation went in one ear and out the other. There is at least one topic brought up here that I very much agree with, and we will take steps to address it. Also, thank you for clearing up your statement.