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

Make escapeExpression public #18791

Closed
wants to merge 1 commit into from
Closed

Conversation

sandstrom
Copy link
Contributor

@sandstrom sandstrom commented Mar 2, 2020

This is a sibling method to htmlSafe. It's currently not available under the module import scheme.

It has historically been provided under Handlebars.Utils.escapeExpression.

A few open questions:

  • This is not a re-export from handlebars, it's implemented in the Ember codebase. But that's also what's been done with htmlSafe[1] so I assume it'll work for this method too.

  • Do we want to use the name escapeExpression? I think escape would be better

These files may need updating too:

Closes #16817

For reference, here is the RFC that moved htmlSafe. It does not mention escapeExpression.


[1] https://github.com/emberjs/ember.js/blob/v3.16.1/packages/%40ember/-internals/glimmer/lib/utils/string.ts#L60-L86

@MelSumner
Copy link
Contributor

I'll add this to our next meeting agenda- this might require an RFC.

@MelSumner
Copy link
Contributor

After discussing with the core team today- we've decided to not move forward with this PR because Ember doesn't use it internally, and hasn't for quite some time now- it was always an artifact from Handlebars itself.

The work for the module RFC removed non-Ember re-exports, and authors were advised to import what they need directly from any particular non-Ember module (e.g., rsvp or jQuery). This is still our position.

If you feel like you still have a use case, please submit an RFC.

@MelSumner MelSumner closed this Mar 6, 2020
@sandstrom
Copy link
Contributor Author

sandstrom commented Mar 9, 2020

@MelSumner Alright, thanks for the update!

Unless I've missed something, anyone implementing escapeExpression themselves will have to rely on the private API of SafeString (it seems to be private). Was that aspect discussed at the core meeting? I tried to find the meeting notes to read myself, but couldn't.

emberjs/rfcs#603

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

Successfully merging this pull request may close these issues.

Where is Ember.Handlebars.Utils.escapeExpression in the @ember module system?
2 participants