-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Rewrite Basic-Web_Skeleton_App to reflect comments on github/gitter #669
Rewrite Basic-Web_Skeleton_App to reflect comments on github/gitter #669
Conversation
I wouldn't use the fetch javascript method as a replacement for jquery ajax/get/post or the standard XMLHttpRequest, as fetch is not widely supported http://caniuse.com/#feat=fetch. It would be underwhelming to load this to a esp with this example and have it fail because of a javascript error, as it would most likely be the place to start for a new comer to sming. I'm guessing that the reason for moving away from jquery is to save space and limit additional requests, but if you go down the path of using fetch you will have to use a polyfill such as https://github.com/github/fetch to overcome the browser support issues, which in turn adds another request to the esp anyway. Just my opinion but I would use widely supported javascript api calls or jquery whilst writing any web related examples for sming. Cheers. |
@MrAPierce Good comment! thanks! Removal of jquery was for several reasons: as you guess - size reduction, useless of jquery for this app as all jquery do can be done with modern js itself if we do not need ANCIENT browsers, so I think pure js is better then teach newcomers rather bad practice to use jquery everywhere even for trivial getelementById... about fetch - it is future, not so far future and it syntax is much more clear and simple even for people who do not fully understand promises and what really happen under the hood :) With fetch it will be easier for newcomers to write their get/post requests. people tend to use what they see for the first time :) But as you said fetch isn't natively supported by all major browsers, so I think using polyfill wil be good compromise.. Will gladly hear any further comments! |
@avr39-ripe I second to include the polyfill in order to keep cross compatibility |
@MrAPierce @patrickjahns So I add fetch polyfill to web ui |
@avr39-ripe :
On the "loop" : In short : it is a good start for a better example but definitely needs some more work. |
@avr39-ripe If there are useful changes in this PR can you rebase it according to the latest develop? |
it is outdated mostly. Bit later will publish my recent work for things like this WebSkeletonApp |
#668 - can be merged separately, but merge of this PR is PREFERABLE prior to merge this PR
#666 - is MANDATORY for this PR.
Also for proper function of WebSkeletonApp in different networking env PR #631 + #622 SHOULD be merged
Fully rewrite WebSkeletonApp, most notable changes: