Closed trevordmiller closed 10 years ago
Which linter are you using? SublimeLinter only seems to bark when use strict
is missing from an actual .js
file.
I think I've fallen into the habit of not using 'use strict' when I've got script blocks in my imports. To properly isolate it you would need to wrap the contents of every script block in an IIFE, otherwise when you vulcanize all of your elements together you could cause some elements to enter strict mode which previously were not strict.
I did a really rough test using console.time
to see the difference between registering 50 polymer elements with and without IIFE wrappers. On average it seems like you can register 50 elements from ~0.170ms - ~0.300ms depending on the browser.
In Chrome, adding 50 IIFEs didn't create a ton of additional overhead, typically remaining below ~0.20-0.25ms. In FF it doubled the time to around 0.80ms and in Safari it pushed the time to around 1.2ms up from 0.2ms. I'd imagine that number would be higher on mobile Safari.
I don't want to get too hung up on microbenchmarks so I guess it's worth it to consistently use strict mode and the IIFEs have the added benefit of preventing folks from accidentally creating global variables (thinking that their imports are JS scoped). I'll add the change and if folks don't like it we can think about removing it at a later date
All of these should be fixed on master now
Awesome. You are the man Rob ;) @robdodson
class="no-js"
on tag. Since the class is not actually being used, can it be removed?.jshintrc
,indent
is set to4
; however, in the .editorconfig, the indent is set to2
. Should these be the same? Matching the.jshintrc
in the Web Starter Kit might make sense, in my opinion....jshintrc
,strict
is set totrue
; however, strict mode is not being used in the example yo-list.html and yo-greeting.html, so my linters are throwing errors. Shoulduse strict;
be added to the examples and el subgenerator?.jshintrc
, the only global variable listed is "wrap", so the instances ofPolymer
are showing up as errors in my linter. ShouldPolymer
be added to the list of variables in.jshintrc
? Or does this mean that"newcap": false
should be used?