babel / babel/website

REPL: default to preset-env that matches babel version

Open
#1,516 0 comments 0 reactions 0 assignees View on GitHub
repl
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

Some followup to https://github.com/babel/website/pull/1415.

If I load the repl with the following (no presets enabled, babel@7.0.0-beta.38):
http://babeljs.io/repl#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAEBCYCMCmJoG8C-Q&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=true&lineWrap=true&presets=&prettier=false&targets=&version=7.0.0-beta.38

And then click preset-env, it loads preset-env@7.0.0-beta.32.

Another example, (preset to env, babel@7.0.0-beta.38, no env version stated):
http://babeljs.io/repl#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAEBCYCMCmJoG8C-Q&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=true&lineWrap=true&presets=env&prettier=false&targets=&version=7.0.0-beta.38

In both of these cases, I think it should load a matching preset-env version (if possible)?

Also, right now we're always writing the env version to the query string... I feel like we should support it without.

/cc: @yavorsky

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Babel website REPL entry point and inspect how the version and preset query parameters select preset-env. Compare the loaded preset-env version with the Babel version, including URLs where the env version is omitted. Done means the REPL selects a matching preset-env version when possible and supports omitting that version from the query string.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.