-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Refactored html-tools and htmljs to move ES6 version #385
base: release-3.0
Are you sure you want to change the base?
Changes from 2 commits
d9c3ada
48b6c77
895c109
e65274b
24ed805
a8cee70
836c76e
366d397
e18db10
b6d8d77
e2bed38
8bde88f
8e47093
7ebe904
b077fc7
cc378df
3bd7704
bc17f49
b388410
b6a0019
51c5592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-env meteor */ | ||
import { HTMLTools } from 'meteor/html-tools'; | ||
|
||
const { Scanner } = HTMLTools; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I think the old way was more straightforward to read - |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-env meteor */ | ||
Package.describe({ | ||
name: 'html-tools', | ||
summary: 'Standards-compliant HTML tools', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛑 OK... I think this is a blocker - re-sorting / rearranging all the functions makes this one really hard to review... why has this been rearranged @guncebektas ? |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the whitespace conversion distracts from the es6 updates unfortunately. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
// _assign is like _.extend or the upcoming Object.assign. | ||
// Copy src's own, enumerable properties onto tgt and return | ||
// tgt. | ||
const _hasOwnProperty = Object.prototype.hasOwnProperty; | ||
const _assign = function (tgt, src) { | ||
for (const k in src) { | ||
if (_hasOwnProperty.call(src, k)) tgt[k] = src[k]; | ||
} | ||
return tgt; | ||
}; | ||
|
||
export function TemplateTag(props) { | ||
if (!(this instanceof TemplateTag)) { | ||
// called without `new` | ||
return new TemplateTag(); | ||
} | ||
|
||
if (props) _assign(this, props); | ||
if (props) Object.assign(this, props); | ||
} | ||
|
||
_assign(TemplateTag.prototype, { | ||
Object.assign(TemplateTag.prototype, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kind of like this one, if it does the same thing indeed :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
constructorName: 'TemplateTag', | ||
toJS(visitor) { | ||
return visitor.generateCall(this.constructorName, _assign({}, this)); | ||
return visitor.generateCall(this.constructorName, Object.assign({}, this)); | ||
}, | ||
}); |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, hard to parse changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question @jankapunkt @guncebektas : Does this have to be included in different files? Isn't there a default .eslintrc or something for blaze which should contain this?