archive-website
archive-website copied to clipboard
Support multiple ESLint versions in demo
It's useful to be able to create a demo permalink like this as an easy way to demonstrate a bug. Ideally, we could allow users to supply a demo URL as an alternative to a code/config sample when reporting a bug.
However, since the demo always uses the latest version of ESLint, demo URLs aren't ideal with respect to archival, because after a bug is fixed the demo will only display the fixed behavior. This might make it difficult to tell what the bug originally was, which could cause problems when trying to figure out whether a certain piece of code is necessary (if the code was originally added while addressing the bug).
To fix this issue, I think it would be nice if the demo supported multiple ESLint versions, perhaps selected with a dropdown menu. The permalink produced by the demo would include the ESLint version (defaulting to the latest version), and when loading a permalink, the appropriate version would be extracted from the URL and configured in the demo.
This would require some changes to the automatic site generation in the ESLint repository, because we would have to copy the generated browser file to a versioned location in addition to putting it at js/app/eslint.js
. We would also want to update the frontend code of the demo to load ESLint versions on-demand.
I like this idea! Are you envisioning having every minor version available or just the latest of each major?
I was thinking we would support every released version (assuming the site updates would be automatic, it doesn't seem like there would be much of a disadvantage to having fine-grained version options for future versions). If we wanted, we could also run a one-time script to extract old versions of ESLint, based on the contents of js/app/eslint.js
at different points in the git history. (At a certain point, the past versions would stop working if they no longer support the APIs used by the demo. For example, I don't think we would be able to go before v4.0.0, since that's when the Linter
class was introduced.)