Sunday, May 12, 2024
HomeJavaScriptThe Ember Instances - Challenge No. 156

The Ember Instances – Challenge No. 156


👋 Emberistas! 🐹

Learn the weblog submit on utilizing ember-concurrency with TypeScript 🤝,
reusable DOM habits in React vs Ember 🪔,
and final, however not least, Mirage JS with GraphQL 🏝!


James C. Davis (@jamescdavis) wrote a weblog submit summarizing tips on how to use TypeScript with ember-concurrency in addition to some greatest practices.

ember-concurrency is an addon that manages asynchronous duties in Ember purposes. The addon historically exports a job operate which is used equally to a computed property.

import { job } from 'ember-concurrency';

export default Element.lengthen({
  myTask: job(operate*() {
    yield foo;
    return bar;
  })
}

The weblog submit goes by means of tips on how to use ember-concurrency with Ember Octane and TypeScript. For Octane, we have to use Native Class Syntax. The ember-concurrency-decorators bundle was created to make this work for ember-concurrency.

Nevertheless, decorators can not change the kind of the factor they enhance. To permit TypeScript, the ember-concurrency-ts bundle was created to supply a few utility features equivalent to taskFor.

Lastly, the ember-concurrency-async bundle offers a Babel rework that permits you to outline ember-concurrency duties utilizing async/await slightly than generator operate. This simplifies utilizing taskFor on project whereas offering full type-safety for ember-concurrency duties.

Learn the full weblog submit with all the guidelines and methods and take a look at it out your self right now!


Raja SK wrote a weblog submit evaluating React and Ember’s strategy to creating reusable parts that cope with DOM behaviors. He talks about tips on how to strategy the identical utilizing the next patterns:

  • React’s class-based and useful element strategy
  • Ember’s mixin and modifier strategy.

He additionally talks about tips on how to use the ember-modifier addon in case you have been utilizing the Ember mixin patterns thus far for DOM behaviors and sharing code between parts.

Learn the full weblog submit right now!


Have you ever been wanting to make use of Mirage JS with GraphQL?

Because of Rocky Neurock (@jneurock), Mirage GraphQL offers the power to create a GraphQL route handler based mostly in your GraphQL and Mirage schemas.

Mirage GraphQL does a bunch of issues:

  • It fulfills GraphQL requests by fetching information from Mirage’s database.
  • It filters data from Mirage’s database through the use of arguments out of your GraphQL queries.
  • It handles create, replace and delete sort mutations robotically based mostly on some conventions.
  • It permits you to provide your personal resolvers (for circumstances the place the automated question and mutation decision is not enough).

There’s loads of examples on tips on how to get began utilizing GraphQL with Mirage JS utilizing Mirage GraphQL over on the repo, go forward and examine them out for your self.


This week we might wish to thank @kiwiupover, @rwjblue, @pzuraq, @rjschie, @arthirm, @kategengler, @richgt, @JoaoDsv, @snewcomer, @igorT, @st-h, @mansona, @pdud, @mehulkar, @bmish, @jaredgalanis, @abhilashlr, @chrisrng, @jenweber, @nickschot, @sly7-7, @superlou, @amyrlam, @hergaiety 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 underneath bit.ly/ask-ember-core. And don’t fear, there aren’t any foolish questions, we admire all of them – promise! 🤞

Wish to write for the Ember Instances? Have a suggestion for subsequent week’s situation? 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 may also discover our posts on the Ember weblog.


That is one other wrap! ✨

Be variety,

Chris Ng, Abhilash LR, Jared Galanis, Amy Lam and the Studying Crew



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments