Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Support multiple ESLint versions in demo #509

Open
not-an-aardvark opened this issue Oct 8, 2018 · 2 comments
Open

Support multiple ESLint versions in demo #509

not-an-aardvark opened this issue Oct 8, 2018 · 2 comments
Labels
demo Relates to the ESLint demo page (https://eslint.org/demo) enhancement This change enhances an existing feature of the website

Comments

@not-an-aardvark
Copy link
Member

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.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Oct 8, 2018
@kaicataldo
Copy link
Member

I like this idea! Are you envisioning having every minor version available or just the latest of each major?

@kaicataldo kaicataldo added enhancement This change enhances an existing feature of the website demo Relates to the ESLint demo page (https://eslint.org/demo) and removed triage An ESLint team member will look at this issue soon labels Oct 8, 2018
@not-an-aardvark
Copy link
Member Author

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.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
demo Relates to the ESLint demo page (https://eslint.org/demo) enhancement This change enhances an existing feature of the website
Projects
None yet
Development

No branches or pull requests

2 participants