Is Modernizr required/used by other packages by default? - asp.net

Is the Modernizr required by jQuery, Bootstrap? I seen this nuget package in many MVC.ASP 4.7 projects and just tried to create a new project where it is automatically added. I never used it and I wonder if I can just remove it?

Modernizr is a small, simple and open-source JavaScript library that helps us to take advantage of emerging web technologies; HTML5 and CSS3 maintain the look and feel for older browsers that may not yet support these new technologies.
If you create an ASP.NET MVC Web Application, you get this library by default and by expanding the "Scripts" folder.
Modernizr does three things basically.
It adds classes indicating feature support.
It allows to run feature detection to decide whether to run a script.
It injects html5shiv for allows old browsers to understand HTML5 elements.
If you don't use any of these features, then there's no point in including Modernizr at all.

Related

A-Frame web component compatibility

I have had a look at the A-Frame 3d/Virtual Reality specification:
aframe.io
Although it appears to nod in the direction of Web Components it doesn't appear to conform to the emerging Web Components standards.
As someone has already pointed out on Stackoverflow it uses document.registerElement which is deprecated.
Is it intended that A-Frame will comply with the Web Components standards?
According to old issues here and here on A-Frame github repository:
It's something we'll look at once there's wide support of V1. But switching from polyfill to polyfill will likely introduce bugs due to how closely A-Frame relies and overrides the current one. A-Frame doesn't use vanilla registerElement behavior.
registerElement() is deprected but they use a polyfill, so it will still work in the future.
You'd better ask directly to A-Frame for an update.

Modernizr build combination with child theme support

I'm building a WordPress theme which I intend to make available for download, and I want developers to be able to make child themes for it. I would like to use Modernizr in it, but not an entire Modernizr build with every bell and whistle. Just a bare-bones build for the features I need, but also with support for child theme builders who want to add more Modernizr features. Is there a way to do that? I know Modernizr has an addTest() function, but I don't know if this would cover all bases if I add it in to my Modernizr build.
Modernizr is going to add support for multiple versions being hosted at the same time in the future, but in the mean time the best thing you could do is include the bare bones build, and a comment saying that a build with the follow features is required if they want to modify it.

JavaScript compatibility libraries

Are there javascript libraries that provide forward compatibility with particular implementations? For example, such a library could provide features present in JavaScript 1.6 in a way that's portable across various browsers. It should take advantage of native support for that functionality when available.
Some of the frameworks like JQuery or Prototype provide features that are identical to features in newer versions of JS, but I'd like to both cut down on the size of the library I'm using and ensure full compliance with a standard or published version.
Do libraries such as this exist? Google and wikipedia don't have much to say on this topic.
It looks like there is such a library: the "JavaScript Standard Library" (JSL). It purports to provide as much JS 1.6 compatibility as possible for browsers supporting JS 1.2 or later.
I haven't used it, and am not sure of how well it works. The documentation is written in sketchy English; this could indicate a lack of widespread usage, since otherwise someone probably would have corrected it by now.
To add to the confusion, the site links to a JSL Revision, located on a different website, whose features list indicates that it provides a subset of the features listed at the main page.
The author has written some more about this library and about the general concepts involved in this blog post.
For example, such a library could provide features present in JavaScript 1.6 in a way that's portable across various browsers. It should take advantage of native support for that functionality when available.
This is pretty much what the frameworks do, and do well (even though most of the compatibility gaps they close are DOM and CSS related). I'm not aware of a general purpose framework with a focus on forward compatibility. Not sure whether something like that can exist at all, because looking at the Wikipedia article, many of the improvements in any version are constructs and behaviours that are very, very hard to simulate in an older version of the language (e.g. let, expression closures...)

How will the ratification of HTML5 affect JSF, Struts, ASP.NET etc?

There is a lot of chatter about the improvements HTML5 is about to unleash on the web development world. How will this new standard affect web dev frameworks like Faces, Struts, or even ASP.NET? How long will it take them to 'catch up' in order to emit such code? Will controls get deprecated?
There will be little effect for quite some time. There are still so many people using browsers that don't support it.
Having said that, in time this situation will gradually change. I don't think that controls will be deprecated because they don't generally render the tags that have been removed from the HTML 5 specification. It is more likely that the controls will be updated to render differently depending on the version of HTML targeted, and that new controls will be added to various frameworks to take advantage of the new tags available in HTML 5. They will have to degrade nicely though. Not an easy task.

JQuery or Any other Java Script Lib. for Developing Web application

Recently i completed on mid level web application where i have used telerik controls,
all the developers in project used native javascript functions as well as telerik
functions to work with javascript.
We faced so many cross browser issues in this approach, we have solved all the issues but i am just wondering that what should be the best approach ?
Do i need to consider JQuery for the next project for avoiding cross browser issues or there is any other option
I want my application should work perfectly in (IE 6+, FF 2+ & Chrome)
Please suggest the appropriate solution.
I prefer using jQuery. It helped me lot to develop rich applications without writing code that target each and every browser.
Also I found their documentation to be relatively simple and have a large user base which is quite an advantage for a library. Also there are plenty of plug ins that are built on top of jQuery.
If you are doing trivial amounts of JS, then a framework is usually going to be more bandwidth than it is worth. (It doesn't sound like you are, but I think it is important to get that statement out of the way first).
Once you get into serious amounts of JavaScript, then it is worth looking at the various frameworks out there.
jQuery is popular. I prefer YUI. I've heard good reports about ExtJS for projects described as "web applications". There are a number of other popular choices.
It is worth evaluating which best suits the sort of projects you are working on.
I used telerik controls in the past, and I have to say that they are quite a pain in the butt. They are very rigid and don't allow you any control. I have found that YUI provides you with a solid javascript framework that has all the features telerik offers, but with non of the limitations.
Check it out here
Most people here will suggest you use jQuery. I would suggest you sketch out your requirements and priorities before starting development on your next project and evaluating libraries based on your list of requirements. Using any large general purpose library such as jQuery or Prototype will have implications (download size/delay for user, code quality, trade-offs between generality and speed) you should be aware of before using them.
as most have already posted, it all depends on what you need to do, i used jQuery, script.aculo.us, and Mootools for some time, and for lightweight effects mootools was the most appropriate, as for support and medium sized projects jQuery. script.aculo.us is pretty usefull as it is based on prototype, but it took me some time to figure out how to actually use it effectively
I personally prefer JQuery and ASP.NET AJAX (Microsoft AJAX Library). There are so many JQuery Plug-in available which you can try them out. As for ASP.NET platform, Microsoft AJAX Library is inevitable because of its simplicity and tight integration with ASP.NET controls. Recently, JQuery has attained citizenship in Visual Studio 2008. This should also be taken into account.

Resources