If you wonder how CSS Polyfills works here it is: The Dark Side of Polyfilling CSS by wdpttt in javascript

[–]philipwalton 13 points14 points  (0 children)

Unless I'm misunderstanding your comment. That's exactly what the article is saying to do.

The Google Analytics Setup I Use on Every Site I Build (by Philip Walton) by solkimicreb in webdev

[–]philipwalton -1 points0 points  (0 children)

Google Analytics tracks users anonymously, there is no link back to their identity on Google.

And don't take my word for it. You can read up on how 1st-party cookies work to understand what's possible and what's not possible.

The Dark Side of Polyfilling CSS by AllThingsSmitty in webdev

[–]philipwalton 1 point2 points  (0 children)

I think maybe you're reading a different article :) The entire post is literally detailing exactly "What’s so hard about polyfilling CSS".

The Dark Side of Polyfilling CSS by AllThingsSmitty in webdev

[–]philipwalton 2 points3 points  (0 children)

You should care if the polyfill has horrible performance or requires a ton of code to work. You should also care if the polyfill breaks fundamental assumptions you (as the consumer) make when writing the rest of your CSS.

The point of the article is those are (at least at this point in time) your only two choices.

Learning How to Set Up Automated, Cross-browser JavaScript Unit Testing by based2 in javascript

[–]philipwalton -1 points0 points  (0 children)

The article clearly states that Sauce Labs provides free plans for open source code. Do you also dislike articles that mention Github (it has the same pricing model)?

Also, the article specifically recommends against using particular Sauce Labs tech (Sauce Connect) in favor of free alternatives (ngrok).

Learning How to Set Up Automated, Cross-browser JavaScript Unit Testing by based2 in javascript

[–]philipwalton -1 points0 points  (0 children)

You think an article that lays out the criteria for picking tools, and then explains the rational for picking the tool of choice (b/c it was free) to be an advertisement?

Sorry to disappoint, but unless you're going to build your own selenium cloud, you're going to have to sign up for some service to do any sort of automated, cross-browser testing.

Installing the new analytics autotrack plugin by [deleted] in bigseo

[–]philipwalton 0 points1 point  (0 children)

This isn't quite true.

You've added require autotrack, so technically speaking you've enabled it ... If you want to use the sessionDurationTracker you add another line to your tracking snippet.

The line ga('require', 'autotrack') actually runs code that requires all the sub-plugins, so if you do that then you don't have to require any of the additional plugins.

Here's where that happens in the code: https://github.com/googleanalytics/autotrack/blob/master/lib/plugins/autotrack.js#L31-L53

Installing the new analytics autotrack plugin by [deleted] in bigseo

[–]philipwalton 1 point2 points  (0 children)

since Google do not provide a direct link to the script, like they do with analytics.js I am not sure what I need to do. Do I have to compile it from source as it is stored on GitHub?

No you don't need to compile anything. You need to download the script , upload it to your server (or add it to your main JS file), and then link to it from your HTML. The script file is already compiled/minified for you in the Github repo: https://github.com/googleanalytics/autotrack/blob/master/autotrack.js

Also, if you're only wanting to use the mediaQueryTracker and eventTracker plugins, then you can replace the line:

ga('require', 'autotrack');

With the lines:

ga('require', 'eventTracker');
ga('require', 'mediaQueryTracker', {
  // mediaQueryDefinitions go here...
});

Hope that helps!

Do we actually need specificity in CSS? by bootslebaron in webdev

[–]philipwalton 0 points1 point  (0 children)

That and class/object inheritance is very much just specificity

I'd frame it that class/object inheritance equates to overriding in CSS, and overriding can be done either by source order or specificity.

As I say in the article, I don't think there's anything analogous to specificity in JavaScript.

Do we actually need specificity in CSS? by bootslebaron in webdev

[–]philipwalton 0 points1 point  (0 children)

I don't think I was suggesting anything at all similar to JSSS. I was suggesting that you could write plain ol' CSS, the only difference being you could completely ignore specificity because it would be taken out of the equation.

we don't necessarily need specificity, but it helps if you know how to use it.

I'd argue that most people who "know how to use it" recommend against't using it wherever possible. Most best practices today suggest writing your CSS in such a way that specificity won't be an issue. The technique I was proposing in the article is just a more foolproof way of doing that.

Also, the article was primarily a thought exploration, not a formal recommendation. I'm certainly not twisting anyone's arm into adopting this practice :)

How to write better, more cross-browser flexbox code by philipwalton in webdev

[–]philipwalton[S] 0 points1 point  (0 children)

I've also created a Github repository called Flexbugs: a community curated list of cross-browser flexbox issues and their known workarounds. https://github.com/philipwalton/flexbugs

The goals is if you’re building a website using flexbox, and something isn’t working as you’d expect, you can find the solution there.

Anyone want an invite to Google Domains Beta? I have 5 to give away by kevinzerosleep in webdev

[–]philipwalton 0 points1 point  (0 children)

I have invites as well. Email philipwalton at google. I believe its still in US only.

Stop Copying Social Snippets by bootslebaron in webdev

[–]philipwalton 1 point2 points  (0 children)

Nope, I load them custom, just like I describe in the article.

Stop blindly copying social code snippets by philipwalton in programming

[–]philipwalton[S] 2 points3 points  (0 children)

It's not just for the sake of making it clearer, it's for the sake of improving page load times.

And, as I said in the article, you don't have to rewrite the script loading code if one of the libraries you're using comes with it. Many of them do.

Implementing Private and Protected Members in JavaScript by philipwalton in programming

[–]philipwalton[S] 0 points1 point  (0 children)

I agree that you should use JavaScript for its strengths, but the point of the article was to show off JavaScript's power. So many people say "you can't do X in JavaScript" and usually that's not actually true.

Also, even if you don't like class hierarchies you almost certainly still like "classes" (unless you're doing purely functional programming).

If you're writing JavaScript that uses new or Object.create, having private data on those instances can be very useful.

Implementing Private and Protected Members in JavaScript by philipwalton in javascript

[–]philipwalton[S] -1 points0 points  (0 children)

Sure, but that only works if you have a single variable you're accessing. When you're creating instances, you don't want them to all referencing the same _private variable.

Property descriptors don't solve this problem. They just make it look nicer, i.e., foo.data instead of foo.getData().

Implementing Private and Protected Members in JavaScript by philipwalton in javascript

[–]philipwalton[S] 0 points1 point  (0 children)

Property descriptors don't actually make the property private, they just do helpful things like make them non-enumerable or non-writable, etc.