Sunday, May 19, 2024
HomeJavaScriptThe Ember Instances - Challenge No. 148

The Ember Instances – Challenge No. 148


👋 Emberistas! 🐹

Watch the brand new EmberMap video on the {{on}} modifier 🔦,
mut and set autotracking in Octane 📖,
Ember Twiddle updates 🌟,
Ember efficiency tweaks 🏎,
preview deployments with ember-cli-deploy and GitHub Actions ✅,
and final, however not least, see helpers spawn from JavaScript recordsdata ✨!


Try the new EmberMap video on the {{on}} modifier, a brand new approach to connect occasions in Ember. It may be hooked up in both a plain HTML ingredient or an Ember element.

<Toggle
  @checked={{this.isAdmin}}
  @onChange={{this.toggleIsAdmin}}
  {{on 'mouseenter' this.showTip}}
  {{on 'mouseleave' this.hideTip}}
/>

The {{on}} modifier accepts two arguments: the occasion title and the perform handler. The occasion title is definitely the identical argument that the vanilla JS API ingredient.addEventListener(eventName) accepts. And the perform handler is any motion, that means any correctly sure perform. It will possibly both stay on the element occasion or be handed in as an argument.

<span
  function='checkbox'
  aria-checked={{if this.isChecked 'true' 'false'}}
  {{on 'click on' this.toggle}}
  {{on 'keydown' this.toggle}}
>
  {{! further HTML }}
</span>

Try the complete video explaining the {{on}} modifier on EmberMap!


There is a new weblog submit 🎉 by Chris Krycho (@chriskrycho) about some conduct that will shock you involving auto-tracking when utilizing mut or the set helper, and the way they will differ from the usage of actions in Ember Octane.

Learn extra about this at Chris’ weblog. It is a fast learn that will forestall you some refactoring ache when you’re conscious of the problems forward of time. 😃


Ember Twiddle 0.17.1 is right here, now supporting Ember 3.18 and template colocation! Have to share an Ember code copy? Ember Twiddle is a JSFiddle for Ember.

Try the updates at ember-twiddle.com and thanks to Gaurav Munjal (@Gaurav0), @RajaSK05 and Gokul Kathirvel
(@gokatz)
for his or her contributions to the discharge! 👏


Abhilash LR (@abhilashlr) blogs about optimizing construct timelines & bundle measurement in your Ember apps, the primary in a sequence on getting began with efficiency optimizations! Try his suggestions and tips within the writeup right here. Highlights embrace:

  • Dashing up growth
    • Eradicating checks from the dev construct
    • Eradicating Mirage from the dev construct
    • Minification, gzip or brotli compression, and fingerprinting
  • Asset measurement
    • Analyze bundle measurement and optimize asset measurement
    • Eradicating dependencies not wanted on app boot

The smaller the web page belongings, the sooner it’s for the consumer to view them. The sooner it’s for the consumer to view the web page with textual content and UI, the better belief they’ve on our apps/web sites.

However wait, there’s extra! In Abhilash’s second a part of the efficiency weblog submit sequence it is all about optimizing belongings for that excellent Lighthouse rating. It teaches you the way to cut back the variety of requests for software belongings to absolutely the minimal, optimize your photographs effectively and lots of different fashionable finest practices associated to asset dealing with.

If you wish to make your personal app load with the pace of sunshine, you should definitely try the writeup right now!


By no means seen a helper spawn from a JavaScript file earlier than? Then you need to try the newest RFC in regards to the invokeHelper API!

The proposal suggests the creation of a brand new API, that permits you to invoke helper features through JavaScript and never solely through templates (the one manner how helpers can invoked in Ember apps right now).
This may prolong Ember’s reactive mannequin by an API that:

  • permits a clear reuse of widespread code and patterns
  • as, equally to parts, proudly owning a lifecycle
  • is, in contrast to parts, JavaScript class and template appropriate.

If you wish to study extra in regards to the API design of invokeHelper, you should definitely learn the full RFC and submit your questions and concepts within the feedback under!


If you have not had an opportunity, we encourage you to take a look at Simon Ihmig (@simonihmig)‘s weblog submit right now. You’ll be able to learn to use ember-cli-deploy plugins and GitHub Actions to preview deployments from pull requests!

PR is deployed and ready for preview!


This week we might prefer to thank @pzuraq, @igorT, @allthesignals, @rwjblue, @chancancode, @lukemelia, @SYU15, @mmun, @mrloop, @runspired and @stefanpenner for his or her contributions to Ember and associated repositories! 💖


Office Hours Tomster Mascot

Questioning about one thing associated to Ember, Ember Information, Glimmer, or addons within the Ember ecosystem, however do not know the place to ask? Readers’ Questions are only for you!

Submit your personal brief and candy query below bit.ly/ask-ember-core. And don’t fear, there aren’t any foolish questions, we respect all of them – promise! 🤞


Wish to write for the Ember Instances? Have a suggestion for subsequent week’s challenge? Be a part of us at #support-ember-times on the Ember Group Discord or ping us @embertimes on Twitter.

Carry on prime of what is been occurring in Emberland this week by subscribing to our e-mail publication! You too can discover our posts on the Ember weblog.


That is one other wrap! ✨

Be type,

Chris Ng, Amy Lam, Jessica Jordan, Isaac Lee, Jared Galanis and the Studying Staff



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments