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

Missing htmlSafe and isHTMLSafe #235

Open
gentoid opened this issue Jan 7, 2021 · 3 comments
Open

Missing htmlSafe and isHTMLSafe #235

gentoid opened this issue Jan 7, 2021 · 3 comments
Assignees

Comments

@gentoid
Copy link

gentoid commented Jan 7, 2021

After bumping Ember to 3.24 in our project I got the following errors:

node_modules/@types/ember/index.d.ts:446:46 - error TS2339: Property 'htmlSafe' does not exist on type 'typeof import("C:/Users/.../node_modules/@ember/string/index")'.

446         const htmlSafe: typeof EmberStringNs.htmlSafe;
                                                 ~~~~~~~~

node_modules/@types/ember/index.d.ts:447:48 - error TS2339: Property 'isHTMLSafe' does not exist on type 'typeof import("C:/Users/.../node_modules/@ember/string/index")'.

447         const isHTMLSafe: typeof EmberStringNs.isHTMLSafe;
                                                   ~~~~~~~~~~

(and a screenshot of the errors if this is helpful)

image

Interestingly enough, this package exposes TS definitions, and also there're definitions at @types/ember__string. And the latter does expose htmlSafe and isHTMLSafe

@gentoid
Copy link
Author

gentoid commented Jan 7, 2021

Oh, this topic has been raised already, in #217, and fixed. But no new releases were since then, so obviously clean install of npm's didn't help. Do you by any chance plan to release new version soon?

@ef4
Copy link

ef4 commented Mar 8, 2022

This continues to be a serious hazard for apps.

The problem is that an addon can pull this package into the build, and it can break an unrelated addon that was relying on the deprecated methods.

Because both ember-source and @ember/string have competing implementations, I have seen it fail inconsistently in very confusing ways:

  • working in the browser while failing in fastboot
  • working in classic builds but failing in embroider

I am in favor of backporting deprecated implementations. As far as I can tell, we should release 1.x, 2.x, and 3.x patches because even @ember/string 3.x supports ember-source 3.x versions that still contain these methods. And the global nature of addons means it's not really safe to remove them while supporting ember versions that contain them.

@kategengler
Copy link
Member

I added versions of these methods that error with explanation in #367

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

4 participants