philipwalton

Joined 14 years ago

Karma
936
Submissions
116
Member since
Mar 23
View on Hacker News

Recent submissions

Comment · 7 years ago
I've updated the article to emphasize that this is indeed something we're experimenting with, and explain a bit more how built-in modules go through the standards process (in general and in Chrome).
Comment · 7 years ago
Article author here,

I probably should have been clearer in the article. I was trying to strike a balance between:

- presenting what I believe to be a compelling and exciting possible future for the web (especially considering it has a viable polyfill story) - getting developers excited about this future and thinking about how it could integrate with existing tooling

and:

- Asking for feedback on the KV Storage and Import Maps APIs themselves. - Encouraging developer to experiment and/or sign up for the origin trial

It's not an easy balance to strike, and in this case I probably should have emphasized more that this is still in the experimentation phase.

I can update the article to make that more clear.

Comment · 7 years ago
This is not different from existing web APIs, which are also not versioned.
Comment · 7 years ago
Comment · 7 years ago
There are links to all the standards work in the article. All of the APIs mentioned are going through the standards process.
Comment · 8 years ago
It's likely not "blocked" by analytics since pretty much all analytics libraries get loaded async.

However, scripts loaded before the `load` event do delay the load event, and analytics script are typically loaded with the lowest priority, so they're usually last and thus the ones you notice in the bottom-left corner of your window.

But the only way they'd be "blocking" anything is if the site was waiting for the load event to initialize any critical functionality (which it shouldn't be).

Comment · 8 years ago
That 56K number isn't gzipped, gzipped it's only 18K (plus there's also some inline JS, some webpack boilerplate, and then analytics.js).

The reason for its size is my site is my playground. It's where I get to experiment with all the things I want to experiment with.

I also work on quite a few open source projects, which I usually test on my site before releasing them publicly just to make sure they work in production without errors.

Comment · 8 years ago
Right, when I said "what's taking so long to run?", in my mind I was thinking there'd be one obviously slow thing that I could just remove or refactor, but it turned out that it wasn't any one single slow function/API causing the problem.

And yes, clearly removing the analytics code would have also solved the problem for me, and in many cases, removing code is the best solution.

In this particular case I couldn't remove any code because I was refactoring an open source library that a lot of people use. I wanted to try to make it better for input responsiveness in general, so people who use the library (and maybe don't know much about performance) will benefit for free.

Also, I wanted to help educate people about how tasks run on the browser's main thread, and how certain coding styles can lead to higher than expected input latency.

Anyway, glad you enjoyed the post!

Comment · 8 years ago
Comment · 8 years ago
Article author here. Most of the comments so far are talking about using lots of tabs, but what I think is actually the most interesting part (or parts) of the article hasn't been mentioned at all.

As I was doing my research for the article, I found a lot of things that really surprised me. And I feel pretty confident in saying that most web developers aren't aware of these things either.

Here are my top four:

- We shouldn't use the unload event. Ever.

- The unload event often doesn't fire when closing tabs/app on mobile

- The pagehide/pageshow events even exist (virtually no one I've talked to knows what they do; most people think they're about page visibility).

- In browsers that implement a page navigation cache, you can click a link to navigate away and then navigate back with the back button, and all your JS code is exactly as it was before you navigated.

To this last point. Try doing this in the console:

1. Write a promise that resolves in a setTimeout after 5 seconds.

2. After 1 second, click a link to navigate to a new page.

3. Stay on that page for an hour.

4. Click that back button.

5. Your promise will resolve in 4 seconds!

Comment · 8 years ago
Comment · 9 years ago
I didn't know about that. I'll look into it!
Comment · 9 years ago
You're right about it not working for webpack dev server, and I agree that it's unfortunate, but I think webpack will evolve to accommodate this.

[EDIT: it looks like this is already supported, here's the documentation explaining how to do it: https://webpack.js.org/configuration/configuration-types/#ex...]

Service Worker already introduced the need (or you could argue possibility) to have multiple configs since SW code has a much different transpiling baseline compared to legacy browser code. And module code just adds one more level to this.

I think webpack dev server will update if this practice becomes popular, but for the moment I think your idea of only building the es2015 build in dev mode is probably the best temporary solution (as long as you make sure to run your test suite in multiple environments and include the legacy build there).

Comment · 9 years ago
*she
Comment · 9 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton