Skip to content
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

Replaces htmlSafe import incorrectly #85

Open
derekwsgray opened this issue May 2, 2018 · 3 comments
Open

Replaces htmlSafe import incorrectly #85

derekwsgray opened this issue May 2, 2018 · 3 comments

Comments

@derekwsgray
Copy link

The codemod inserts import { htmlSafe } from '@ember/template' but it should be from @ember/string

There is a corresponding bug in the Ember API documentation where it still lists the function under @ember/template

@rwjblue
Copy link
Member

rwjblue commented May 2, 2018

Actually, @ember/template is the correct location 😄 (it moved from @ember/string to @ember/template in emberjs/rfcs#236).

@derekwsgray
Copy link
Author

derekwsgray commented May 2, 2018

Guess I'm confused then - The 3.1 docs say string. And @ember/template gives me a 'module not found' at runtime. i.e. right now at 3.1.1, it only works with @ember/string

@patocallaghan
Copy link

patocallaghan commented May 3, 2018

I'm also seeing this behaviour on 2.18.2, @ember/string works but @ember/template does not.

It seems the htmlSafe API docs still links to a htmlSafe within the string module within ember.js. Also the jsdoc comment for htmlSafe seems to be at odds with itself

/**
  Mark a string as safe for unescaped output with Ember templates. If you
  return HTML from a helper, use this function to
  ensure Ember's rendering layer does not escape the HTML.
  
  import { htmlSafe } from '@ember/string';
  htmlSafe('<div>someString</div>')
  
  @method htmlSafe
  @for @ember/template
  @static
  @return {Handlebars.SafeString} A string that will not be HTML escaped by Handlebars.
  @public
*/

It says @ember/string in the code example but the annotation says @for @ember/template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants