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

Change htmlSafe and isHTMLSafe import path #38

Merged
merged 2 commits into from
Dec 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,32 @@
"global": "Ember.String.htmlSafe",
"module": "@ember/string",
"export": "htmlSafe",
"deprecated": true,
"replacement": {
"module": "@ember/template",
"export": "htmlSafe"
}
},
{
"global": "Ember._Template.htmlSafe",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think this needs to stay Ember.String.htmlsafe until we have a way to ensure that the transpilation will work for both [email protected] and [email protected] (soon to include this global).

Thoughts?

Copy link
Member

@Turbo87 Turbo87 Dec 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like global: ["Ember._Template.htmlSafe", "Ember.String.htmlSafe"]?

but if we're going to make the format more complicated we should definitely document the format better 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change it and think how to do different transpilations depending on the version. Keeping an array would force us to transpile to something like:

var x = (Ember._Template && Ember._Template.htmlSafe) || (Ember.String && Ember.String.htmlSafe);

I rather keep two versions (0.x for Ember.String and 0.(x+y) for Ember._Template) than start doing that. In case we want to keep all in one version, I would rather see something like:

{
  "global": [{ "version_selector": "<2.18.0", "global": "Ember.String.htmlSafe"}, { "version_selector": ">=2.18.0", "global": "Ember._Template.htmlSafe"}]
}

"module": "@ember/template",
"export": "htmlSafe",
"deprecated": false
},
{
"global": "Ember.String.isHTMLSafe",
"module": "@ember/string",
"export": "isHTMLSafe",
"deprecated": true,
"replacement": {
"module": "@ember/template",
"export": "isHTMLSafe"
}
},
{
"global": "Ember._Template.isHTMLSafe",
"module": "@ember/template",
"export": "isHTMLSafe",
"deprecated": false
},
{
Expand Down