Hacker News new | past | comments | ask | show | jobs | submit | peterbe's comments login

Shameless plug if it helps anybody else, like it helped me; http://govspy.peterbe.com/


Similarly helpful, pytago is a source to source transpiler for python to go

https://pytago.dev/


What do you miss about it? Can you not find what you're looking for?


The new search tends to give me the CSS property when I want the JavaScript property and the SVG attribute when I want the CSS property etc etc. It’s always choosing the wrong category.


It's pseudo code. The real code is TypeScript React and looks very different and it wouldn't serve the article to take snippets from that code to explain how it works.


Of course, otherwise any amateur would be able to see looping network requests right? Just saying that it'd been good to have accurate pseudocode on an MDN article.


Getting accessibility right is hard. We very much care about that. One of the strong reasons for why we're using Downshift.


> They hi-jacked the browser's `/` key to focus the field, which is something I hate.

You're not the first one to point it out. Please join github.com/mdn/yari to raise your voice. It's an Open Source project after all.

> They should have just had the search field focused automatically

Why? There's a lot of JS to load to make that work. If you never need to do a search (e.g. from a Google search) it would be a potential waste.

> Also, I'm confused, I thought https://mdn.dev/ was the new thing because Mozilla was stepping back from MDN. Is it a fork?

That domain is just an alias we don't currently use. It's still the old MDN from Mozilla. No fork.


> Why? There's a lot of JS to load to make that work. If you never need to do a search (e.g. from a Google search) it would be a potential waste.

Confused by what this comment is meant to say exactly, but just in case its not known already, seems this situation is what the autofocus attribute is for @ https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att..., no JS needed


the op is saying "if we autofocussed, we'd need to load all the JS involved in performing the search"


MDN has 2 search things: 1. client-side only which downloads a complete list of all titles. 2. full-text search on everything with Elasticsearch.


First of all, great write up and interesting solution, thank you for that!

I think GPS question was rather whether the page loads the start autocomplete script on focus, and the script triggers download of the json data, as in the pseudo code, or whether the real code triggers downloading of both in parallel (the script and the json data)?


Relevancy is the huge game-changer. MDN uses pageviews analytics to determine was a "popular" age is.


Indeed, that's a great idea.


(author here) We're still on FlexSearch 0.6 and the new 0.7 is a big refactor. I hope we can upgrade some time.


Any reason for not using semantic versioning?

I see in your npm page that despite compatibility "some adjustments" might be needed, aka you broke compatibility. If you did a breaking change, you need to up that major version my man.

Please stop with this sentimental versioning, it just causes issues for the rest of us who want to rely on npm's ability to not upgrade stuff on breaking changes, now everyone's gonna have to lock you package version to 0.6 so they don't get your breaking stuff from 0.7.


Semver allows for breaking changes with major version 0: https://semver.org/#spec-item-4


<datalist> is awesome! But I find it works better for short options. See https://www.peterbe.com/plog/datalist-looks-great-on-mobile-...


On every document, there are appropriate links at the bottom .


Thanks, I reported it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: