site stats

TypeScript 2.0 beta kicks async support down the road


<!–TypeScript 2.0 beta kicks async make stronger down the street Knowledgeable news diagnosis every weekday</p> </p></div> </p></div> </header> <section class="epo" id="drr-top-ad"><!-- Related --></p> </section> <figure class="hero-img"><img src="http://greattodaynews.com/wp-content/uploads/2016/07/kick-100671483-primary.idge.jpg" alt="TypeScript 2.0 beta kicks async support down the road" /><figcaption> <p> Credit:<span></p> <p> pixabay</p> <p> </span></p> </figcaption></figure> <section class="deck"> <h2>There May Be still so much to like in the latest version of Microsoft’s JavaScript-derived language, like non-nullable variable Types</h2> </section> <div class="modal eml-friend-wrapper" id="emailModal"> <div class="eml-ty eml-friend-success"> <i class="ss-icon ss-delete" /></p> <h3>Thanks</h3> <p class="msg-sent">Your message has been sent.</p> </p></div> <div class="eml-friend-error"> <i class="ss-icon ss-delete" /></p> <h3>Sorry</h3> <p class="msg-sent">There used to be an error emailing this WEB PAGE.</p> </p></div> </div> <section class="bodee"> <p>$(‘#” + slotName + “‘).responsiveAd(screenSize:’971 1115’, scriptTags: []);if (Object.keys(IDG.GPT.companions).size > Zero) IDG.GPT.refreshAd(‘” + slotName + “‘);”;<br /> var adDivString = “</p> <p>” + adString + “</p> <p>“;</p> <p> placementDiff = applyInsert($(this), adDivString);<br /> if (debug)<br /> console.log(“Simply placed an Advert and the placementDiff is: ” + placementDiff);</p> <p> placementTarget = cumulativeHeight + placementDiff + interModuleHeight + adHeightBuffer;</p> <p> else<br /> var moduleDivString = “”;<br /> var elementId = “drr-mod-“+moduleCounter;<br /> moduleDivString = “”;<br /> modules.push(elementId);</p> <p> placementDiff = applyInsert($(this), moduleDivString);<br /> if (debug)<br /> console.log(“Just placed a module and the placementDiff is: ” + placementDiff);</p> <p> placementTarget = cumulativeHeight + placementDiff + interModuleHeight + moduleHeightBuffer;<br /> moduleCounter++;</p> <p> loopCounter++;</p> <p> // Avoid putting Components too soon due to non-huge figures inflating the cumulative Peak<br /> if ($(this).is(“Determine”) && !$(this).is(“Determine.huge”))<br /> cumulativeHeight += grafHeight;</p> <p> else<br /> cumulativeHeight += $(this).Top() + grafHeight;</p> <p> );</p> <p> // clone Related Tales module to come back in after eighth para in article body for Cellular breakpoint display<br /> var $relatedStories = $(‘.Associated-promo-wrapper’);<br /> if ($relatedStories.size)<br /> var $relatedStoriesClone = $relatedStories.clone();<br /> $relatedStoriesClone.insertAfter( “#drr-container > p:eq(7)”); </p> <p> // For Mobile most effective, Place Advert after second paragraph.<br /> if (firstMobileAdHtml)<br /> $(firstMobileAdHtml).insertAfter(“#drr-container > p:eq(1)”);</p> <p> var $insiderPromo = $(‘.insider-promo-wrapper’);<br /> if ($insiderPromo.length)<br /> var $insiderPromoClone = $insiderPromo.clone();<br /> $insiderPromoClone.insertAfter( “#drr-container > p:eq(1)”);</p> <p> //Place left facet Component<br /> cumulativeHeight = 0;<br /> var leftPlacementTarget = tagHeight = leftPlacementTarget)<br /> if (debug)<br /> console.log(“congratulations… now we have handed the initial Begin level”);</p> <p> if (leftPlacementIndex == null)<br /> //it is Not good sufficient to Now Not be a left Steer Clear Of – it additionally is just not a </p> <p> with an straight away previous small or medium picture left Keep Away From.<br /> if (!isLeftAvoid($(this)) && noPrevFigures($(this)) )<br /> leftPlacementIndex = $(this).index();<br /> $leftPlacementElement = $(this);<br /> leftPlacementLookaheadStart = cumulativeHeight;<br /> if (debug)<br /> console.log(“is not a left Keep Away From and no prev figures. ########## set placementIndex (“+leftPlacementIndex+”) and lookaheadStart (“+leftPlacementLookaheadStart+”) ##########”);</p> <p> else<br /> if (debug)<br /> console.log(“is a left Steer Clear Of or has earlier figures. continue”);</p> <p> else<br /> if (debug)<br /> console.log(“#### leftPlacementIndex already set to “+leftPlacementIndex+”. looking AHEAD…”);</p> <p> //Now Not null; has been set<br /> if ((cumulativeHeight – leftPlacementLookaheadStart) > leftIntervalHeight)<br /> if (debug)<br /> console.log(“###### THRESHOLD REACHED. LOOKAHEAD FULL. Finish ###### (cumulativeHeight – leftPlacementLookaheadStart) (“+(cumulativeHeight-leftPlacementLookaheadStart)+”) > leftIntervalHeight (“+leftIntervalHeight+”).”);</p> <p> return false;<br /> else<br /> if (debug) $(this).hasClass(‘inline-small’)<br /> );</p> <p> if (leftPlacementIndex != null && elementNotNearEnd($leftPlacementElement, leftPixelWindow))<br /> if (debug)<br /> console.log(” insert into index “+leftPlacementIndex);</p> <p> $(“#drr-container”).children().eq(leftPlacementIndex).earlier than(“</p> <p>“);</p> <p> IDG.GPT.trackOmniture();</p> <p> // Add Proper rail module content material<br /> for (var i=Zero; i” + adString + “</section> </article> </section> </div> <p>“;</p> <p> perform getEpoParams()<br /> var Components = file.referrer.replace(/^https?:///, ”).split(‘/’);<br /> var defaultCatId = 3029;<br /> var defaultTypeId = 2;<br /> var epoParams = “module.epo”;</p> <p> Elements.shift();</p> <p> // From HOMEPAGE; Convey default typeId articles<br /> if (Components.subscribe to(‘/’) == “” && report.referrer.indexOf(document.domain)) </p> <p> epoParams += “&typeId=” + defaultTypeId + “&referrer=RESIDENCE”;</p> <p> // From ARTICLE: Exhibit articles w referrer catId<br /> else if (record.referrer != undefined && record.referrer.indexOf(‘article’) >= 0)<br /> var a = report.createElement(‘a’);<br /> a.href = report.referrer;<br /> var uriParts = a.pathname.split(‘/’);<br /> a = ”;<br /> if (typeof uriParts[3] == ‘undefined’)<br /> epoParams += “&typeId=” + defaultTypeId + “&referrer=DWELLING”; // default is ‘HOME’ conduct</p> <p> else<br /> var refCatSlug = uriParts[3];<br /> epoParams += “&catSlug=” + refCatSlug + “&referrer=article”;</p> <p> // From SEARCH: Show article with catId similar as present article<br /> else if (file.referrer.indexOf(“google”) >= Zero </p> <p> /**<br /> * @param jqo Authentic jquery object Target<br /> * @param divString The div to be inserted.<br /> * @return Distinction in Top between Unique placement Goal and closing Target.<br /> * Checks first 6 Elements for an allowable placement (600 pixel window).<br /> * If none, Check nearby for Components that aren’t Right avoids.<br /> * If none, Location Element prior to current Goal.<br /> */<br /> operate applyInsert(jqo, divString)<br /> return false;</p> <p> // Return proper if Component has Type ‘reject’: is not going to Place drr modules/ads subsequent to those Components<br /> perform isRightReject(jqo)<br /> console.log(“in isRightReject”);<br /> if (jqo != null)<br /> if (jqo.hasClass(“reject”))<br /> if (debug)<br /> console.log(“isRightReject: found ‘reject’ Class”);</p> <p> return proper;</p> <p> return false;</p> <p> return false;</p> <p> // Returns true if Height of all Parts after this one is more than 500; false otherwise<br /> operate elementNotNearEnd(Part, pixelWindow)<br /> if (pixelWindow == null)<br /> pixelWindow = 500;</p> <p> if (Part == null)<br /> return false;</p> <p> var remainingHeight = 0;<br /> var youngsters = $(“#drr-container”).youngsters().slice(Element.index());<br /> if (children == null)<br /> return false;</p> <p> youngsters.EACH AND EVERY(operate(i)<br /> remainingHeight += $(this).Peak();<br /> );<br /> if ( remainingHeight > pixelWindow)<br /> return genuine;</p> <p> else<br /> if (debug)<br /> console.log(“Element too as regards to End. Ultimate Top is: ” + remainingHeight + ” and window is ” + pixelWindow); </p> <p> return false;</p> <p> /**<br /> * Return authentic if need to Keep Away From this Element when placing left module.<br /> */<br /> perform isLeftAvoid(jqo)<br /> if (jqo.is(“Figure”))<br /> if (debug)<br /> console.log(“isLeftAvoid: discovered Figure. return authentic”);</p> <p> return true;</p> <p> if (jqo.is(“aside.pullquote”))<br /> if (debug)<br /> console.log(“isLeftAvoid: discovered pullquote. return real”);</p> <p> return proper;</p> <p> if (jqo.is(“pre”))<br /> if (debug)<br /> console.log(“isLeftAvoid: discovered pre. return authentic”);</p> <p> return proper;</p> <p> if (jqo.is(“div.gist”))<br /> if (debug)<br /> console.log(“isLeftAvoid: found github code block. return true”);</p> <p> return true;</p> <p> if (jqo.is(“apart”) && jqo.hasClass(“sidebar”) && jqo.hasClass(“medium”))<br /> if (debug)<br /> console.log(“isLeftAvoid: discovered medium sidebar. return authentic”);</p> <p> return genuine;</p> <p> if (jqo.hasClass(“statsTable”))<br /> if (debug)<br /> console.log(“isLeftAvoid: discovered Classification statsTable. return authentic”);</p> <p> return actual;</p> <p> if (jqo.hasClass(“product-sidebar”) && jqo.Now Not(“.fullwidth”).length > 0)<br /> if (debug)<br /> console.log(“isLeftAvoid: found Type product-sidebar. return actual”);</p> <p> return proper;</p> <p> return false;</p> <p> /**<br /> * return proper if there are no figures earlier than the Goal placement that may bleed down into placement Part<br /> */<br /> operate noPrevFigures($originalTarget)<br /> var targetIndex = $originalTarget.index();<br /> var numElementsLookBack = 5;<br /> var figureIndex = null;<br /> var figureHeight = null;<br /> var startIndex = targetIndex – numElementsLookBack </p> <div id="drr-container"> <p>The First beta of Typescript 2.Zero, the latest version of Microsoft’s “industrial-energy JavaScript,” was introduced earlier this week.</p> <p>The bad information: It would not deliver the whole lot that was promised for 2.Zero. It does, then again, present a slew of new features for Kind-checking — lengthy thought of as the largest advantage TypeScript provides for JavaScript programmers.</p> <p>Some Of The large additions promised for 2.0 —  non-nullable Sorts — is being delivered. Move a flag to TypeScript and it will ensure that, for instance, strings or numbers never end up being assigned to <code>null</code> or <code>undefined</code>. In circumstances where you <em>do</em> need something to receive those values, <code>null</code> and <code>undefined</code> at the moment are to be had as their own Sorts.</p> <p>In circumstances the place you need to override the sort gadget’s protections, Microsoft allows a solution to conditionally override it. Add “<code>!"</code> as a postfix to any variable (e.g., <code>user_name!</code>), and TypeScript will assume the variable in question does not wish to be guarded in opposition to <code>null</code>/<code>undefined</code> Checks.</p> <p>Now Not all of 2.Zero’s additions revolve around Types; some deal with the workflow round a script. Module declarations, for instance, are more uncomplicated to jot down this time around. A developer in a hurry can Begin with a stub statement that has no actual code in it, or even declare an entire package of modules in this model.</p> <p>What’s lacking from 2.0 — as a minimum for now — is give a boost to for <code>async</code>/<code>watch for</code>. These key phrases had been <a href="http://www.infoworld.com/article/3005553/javascript/ecmascript-2016-will-add-simd-capabilities-and-async-functions.html">offered in ECMAScript 2016 to make asynchronous programming more uncomplicated, in the same method as equivalent key phrases for C#, Dart, and Python. One boon is that TypeScript code written with <code>async</code>/<code>watch for </code>may also be compiled down to versions of JavaScript (EC5, as an example) that do not give a boost to those keywords.</p> <p>Microsoft’s beta notes point out that the main reason for the delay in give a boost to was to verify TypeScript could generate the wanted <code>async</code>/<code>look ahead to</code> code quick sufficient, and to completely check the resulting behaviors. “Whereas we feel confident in these days’s implementation, self assurance isn’t any fit for thorough testing,” Microsoft wrote.</p> <p>Consequently, <code>async</code>/<code>await</code> fortify has been bumped to the 2.1 unlock.</p> <aside class="nativo-promo tablet desktop" id="" /></div> <div class="byline vcard author end-byline"> <p><img class="bylineImage imgId100354801 " src="http://greattodaynews.com/wp-content/uploads/2016/07/1468425091_serdaryegulalp2_crop-100354801-byline.jpg" alt="Serdar Yegulalp" /></p> <p> <!-- end .author-info --></p> </div> <p><!-- blx4 #1218 blox4.html --></p> <div class="article-intercept"> <a href="http://www.cio.com/article/2847396/it-skills/8-free-online-courses-to-grow-your-tech-skills.html#tk.cross_2cio_intrcpt"><br /> <i class="ss-icon ss-navigateright" /><em> From CIO:</em> 8 Free Online Classes to Grow Your Tech Skills<br /> </a></p></div> <p> <!-- /.bodee --></p> <section id="funnel"> <section class="popular-brand-cols"> <section class="popular-col"><!-- /.promo --><br /> <!-- ./promo newsletter --></p> </section> <section class="brand-col"> </section> </section> <section class="featured-col"><!-- blx4 #937 blox4.simple --></p> </section> </section> <p> <!-- /role=main --><!-- /#page-wrapper --></p> <footer> <section class="brand"><span class="logo">InfoWorld</span><br /> <span class="tagline"> </span></p> <p> <span class="follow"><br /> <label>Practice us</label><br /> </span></p> </section> <section class="topics"> <nav id="ft1" /> <nav id="ft2" /></section> <section class="about"> </section> <section class="copyright"> <div class="wrapper"> <p>Copyright © 1994 – 2016 InfoWorld, Inc. All rights reserved.</p> <div class="network"> <div id="network-selector"> <p>Discover the IDG Community <i class="ss-icon tick">descend</i></p> </p></div> <p><!-- /#network-selector --> </div> <p><!-- /.network --> </div> <p><!-- /.wrapper --><br /> </section> </footer> <p><!-- Begin welcome ad overlay - gpt-overlay position --><br /> <!-- End welcome ad overlay - gpt-overlay position --></p> <p> <!-- Begin gpt-skin/gpt-pin/inread --></p> <p> <!-- End gpt-skin/gpt-pin/inread --> </p> <p><!-- Begin BlueKai Tag --></p> <p><!-- CryptoJS --></p> <p><!-- End BlueKai Tag --></p> <p><!-- START Nielsen Online SiteCensus? V6.0 --><br /> <!-- COPYRIGHT 2010 Nielsen Online --></p> <p><!-- END Nielsen Online SiteCensus? V6.0 --></p> <p><!-- SiteCatalyst code version: H.26.2. Copyright 1996-2013 Adobe, Inc. All Rights Reserved More info available at http://www.omniture.com --></p> <p><img src="http://idgenterprise.d1.sc.omtrdc.net/b/ss/infoworld-production/1/H.25--NS/0" height="1" width="1" border="0" alt="" /><!--/DO NOT REMOVE/--><br /> <!-- End SiteCatalyst code version: H.26.2. --></p></div> <p><br /> <br /><a href="http://www.infoworld.com/article/3094811/javascript/typescript-20-beta-kicks-async-support-down-the-road.html#tk.rss_all">Supply hyperlink </a></p> <div class="clear"></div> </div><!-- /entry --> <div id="comments"> <p> You must be logged in to post a comment <a href="http://greattodaynews.com/wp-login.php?redirect_to=http%3A%2F%2Fgreattodaynews.com%2Ftypescript-2-0-beta-kicks-async-support-down-the-road%2F"> Login </a> </p> </div><!-- #comments --> </div><!-- /main --> <div id="sidebar"> <div class="sidebarinner"> </div><!-- .sidebarinner --> </div><!-- /sidebar --> </div><!-- /container --></div><!-- end of wrapper --> <div id="footer"> <div id="foo_widget1"> <div id="flickr-widget-3" class="widget flickr_widget"><div class="widgetinner"><h3 class="widgettitle">Flickr Photo Stream</h3> <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=10&display=random&layout=x&source=all_tag&tag=&size=s"></script><div class="clear"></div></div></div> </div> <div id="foo_widget2"> <div id="recent-posts-3" class="widget widget_recent_entries"><div class="widgetinner"> <h3 class="widgettitle">Recent Posts</h3> <ul> <li> <a href="http://greattodaynews.com/affordable-homes-shortage-equivalent-to-size-of-leeds/">Affordable homes shortage ‘equivalent to size of Leeds’</a> </li> <li> <a href="http://greattodaynews.com/four-nhl-hockey-fans-kicked-out-over-racist-comments-toward-player/">Four NHL hockey fans kicked out over racist comments toward player</a> </li> <li> <a href="http://greattodaynews.com/somalia-somali-migrants-returning-from-libya-tell-of-abuse-horror/">Somalia: Somali Migrants Returning From Libya Tell of Abuse, Horror</a> </li> <li> <a href="http://greattodaynews.com/billboards-inspired-by-oscar-contender-challenge-rubio-on-florida-shooting-and-gun-reforms/">Billboards inspired by Oscar contender challenge Rubio on Florida shooting and gun reforms</a> </li> <li> <a href="http://greattodaynews.com/plans-for-school-walkouts-sit-ins-after-florida-shooting/">Plans for school walkouts, sit-ins after Florida shooting</a> </li> </ul> </div></div> </div> </div> <div id="footer_data"> <ul class="footerpages"> <li class="first"><a href="http://greattodaynews.com/" title="Great Today News">Home</a></li> <li class="page_item page-item-6"><a href="http://greattodaynews.com/privacy-policy/">Privacy Policy</a></li> <li class="page_item page-item-195"><a href="http://greattodaynews.com/contact/">Contact Us</a></li> <li class="page_item page-item-198"><a href="http://greattodaynews.com/video-gallery/">Video Gallery</a></li> <li class="page_item page-item-201"><a href="http://greattodaynews.com/sitemap/">Sitemap</a></li> <li><a rel="nofollow" href="http://greattodaynews.com/feed/">RSS</a></li> <li class="right"><a href="#top" title="Great Today News" rel="home"><strong>↑</strong> Great Today News</a></li> </ul> <div class="clear"></div> <p id="footer-left-side"> <a href="http://greattodaynews.com/" title="Great Today News" rel="home">Great Today News</a> </p><!-- #site-info --> <p id="footer-right-side"> <a href="http://greattodaynews.com/wp-login.php">Log in</a> - Designed by <a href="http://www.greattodaynews.com/" title="Today News">Today News</a> <script type='text/javascript' src='http://greattodaynews.com/wp-includes/js/comment-reply.min.js?ver=4.9.4'></script> <script type='text/javascript'> /* <![CDATA[ */ var wpcf7 = {"apiSettings":{"root":"http:\/\/greattodaynews.com\/wp-json\/contact-form-7\/v1","namespace":"contact-form-7\/v1"},"recaptcha":{"messages":{"empty":"Please verify that you are not a robot."}},"cached":"1"}; /* ]]> */ </script> <script type='text/javascript' src='http://greattodaynews.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=5.0'></script> <script type='text/javascript' src='http://greattodaynews.com/wp-includes/js/wp-embed.min.js?ver=4.9.4'></script> </p> <!-- #footer-right-side --> </div><!-- /footer_data --> <div class="hide"> <div id="adv_here"> <h3 class="widgettitle">Widgetized Section</h3> <p>Go to Admin » appearance » Widgets » and move a widget into Advertise Widget Zone</p> </div> </div> <!-- Quantcast Tag --> <script type="text/javascript"> var _qevents = _qevents || []; (function() { var elem = document.createElement('script'); elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; elem.async = true; elem.type = "text/javascript"; var scpt = document.getElementsByTagName('script')[0]; scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push({ qacct:"p-XSTdT3wyH_FGD" }); </script> <noscript> <div style="display:none;"> <img src="//pixel.quantserve.com/pixel/p-XSTdT3wyH_FGD.gif" border="0" height="1" width="1" alt="Quantcast"/> </div> </noscript> <!-- End Quantcast tag --> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/ Page Caching using disk: enhanced Served from: greattodaynews.com @ 2018-02-18 10:35:06 by W3 Total Cache -->