Skip to content

Code blocks in some functions pages not rendering correctly #617

Closed
@Mikek2252

Description

@Mikek2252

https://api.emberjs.com/ember/3.10/functions/@ember%2Fobject%2Fcomputed/filterBy

functions for ember object computed do not correctly render the examples.

I investigated it and it seems like the API does not return the full comment from the release build.

Example of response for filterBy:

"<html><head></head><body><p>Filters the array by the property and value.</p>
<p>Example:</p>
<p>```javascript
import { set } from &apos;@ember/object&apos;;
import { filterBy } from &apos;@ember/object/computed&apos;;</p>
<p>class Hamster {
  constructor(chores) {
    set(this, &apos;chores&apos;, chores);
  }</p>
</body></html>"

It seems to have a problem with decorators when it fetches it from the inline documentation.
As seen here:

  import { set } from '@ember/object';
  import { filterBy } from '@ember/object/computed';
  class Hamster {
    constructor(chores) {
      set(this, 'chores', chores);
    }
    @filterBy('chores', 'done', false) remainingChores; //this line
  }
  let hamster = new Hamster([
    { name: 'cook', done: true },
    { name: 'clean', done: true },
    { name: 'write more unit tests', done: false }
  ]);
  hamster.remainingChores; // [{ name: 'write more unit tests', done: false }]

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions