New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Stage presets #8293

Merged
merged 8 commits into from Jul 24, 2018

Conversation

@hzoo
Copy link
Member

hzoo commented Jul 9, 2018

Sad times 馃槶, but for the best? Fun because I added them back in originally 馃槢

Fixes #7770

We should prob make a better guide on making your own preset

@hzoo hzoo requested review from existentialism and loganfsmyth Jul 9, 2018

@hzoo hzoo added this to the Babel 7 RC milestone Jul 9, 2018

@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Jul 9, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8672/

@chicoxyzzy
Copy link
Member

chicoxyzzy left a comment

Overall this LGTM. Not sure about readmes, where I think we can add list of plugins down to current preset instead of higher stage preset + list of plugins for current preset.

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Jul 11, 2018

I think we can add list of plugins down to current preset instead of higher stage preset + list of plugins for current preset.

Yeah I was thinking that too.

@hzoo hzoo force-pushed the rm-stage-presets branch from b2f42e8 to a509803 Jul 11, 2018

---

If you want the same configuration as before, you can use this configuration, although keep in mind that Stage 0 contains Stage 1 which is also deprecated.

This comment has been minimized.

@chicoxyzzy

chicoxyzzy Jul 11, 2018

Member

This lines in readmes should be reworded somehow (also probably same for deprecation messages) =)

@rtsao

rtsao approved these changes Jul 11, 2018


if (opts !== undefined) {
if (opts.loose !== undefined) loose = opts.loose;
}

This comment has been minimized.

@nicolo-ribaudo

nicolo-ribaudo Jul 12, 2018

Member

Nit: We can just use { loose = false } = {} instead of the opts parameter to avoid lines 7-11.

const { loose = false, useBuiltIns = false, decoratorsLegacy = false } = opts;

return {
presets: [[presetStage3, { loose, useBuiltIns }]],

This comment has been minimized.

@nicolo-ribaudo

nicolo-ribaudo Jul 12, 2018

Member

useBuiltIns can be removed, since it was only used by object-rest-spread.
It can also be removed in the stage-0 and stage-1 presets.

proposals.join(", "),
);
}
We recommend that make your own presets to use across projects for

This comment has been minimized.

@existentialism

existentialism Jul 12, 2018

Member

Nit:

We recommend that you make your own presets...

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo left a comment

Also, you can remove { "loose": false } everywhere since it is the default.

```

or using yarn:
We recommend that make your own presets to use across projects for

This comment has been minimized.

@loganfsmyth

loganfsmyth Jul 15, 2018

Member

Is this something we want to recommend? I'm not sure how I feel about this being in here as a recommendation for good.

This comment has been minimized.

@hzoo

hzoo Jul 15, 2018

Member

Hmm yeah, I guess it shouldn't have to be a recommendation but more that people tend to forget you can make your own

This comment has been minimized.

@loganfsmyth

loganfsmyth Jul 15, 2018

Member

Yeah, I'm fine if we want to say that creating a custom preset is an option, I think the wording right now just makes it sound like what we're expecting everyone to do, which isn't good.

Maybe something like

If you're using the same configuration across many separate projects, keep in mind that you can also create your own custom presets with whichever plugins and presets you're looking to use.

@@ -35,19 +34,6 @@ export default (_, opts) => {
if (opts.spec !== undefined) spec = opts.spec;
}

if (typeof loose !== "boolean") {

This comment has been minimized.

@loganfsmyth

loganfsmyth Jul 15, 2018

Member

What happened with this?

This comment has been minimized.

@hzoo

hzoo Jul 15, 2018

Member

Oh hmm I think I ended up removing this since it's for standalone and it would be a UI option in the repl, but we can add it back too.

This comment has been minimized.

@loganfsmyth

loganfsmyth Jul 15, 2018

Member

Yeah I was just confused because this is only the validation logic, not the options themselves.

module.exports = function() {
return {
plugins: [
// ...

This comment has been minimized.

@loganfsmyth

loganfsmyth Jul 15, 2018

Member

If we want this example, we should probably also clarify that doing require() on these is recommended. If they just do "@babel/plugin-proposal-function-bind" as a string, the plugins will probably not be found properly. I'd actually thought about making core error when that happens, but I haven't yet. Maybe I should?

@hzoo hzoo force-pushed the rm-stage-presets branch from 479d0b5 to 64673ae Jul 16, 2018

calebeby added a commit to Pigmice2733/scouting-frontend that referenced this pull request Jul 17, 2018

Update babel monorepo to v7.0.0-beta.54 (#235)
This Pull Request renovates the package group "babel monorepo".


-   [@​babel/preset-typescript](https://github.com/babel/babel) (`devDependencies`): from `7.0.0-beta.53` to `7.0.0-beta.54`
-   [@​babel/preset-env](https://github.com/babel/babel) (`devDependencies`): from `7.0.0-beta.53` to `7.0.0-beta.54`
-   [@​babel/plugin-transform-react-jsx](https://github.com/babel/babel) (`devDependencies`): from `7.0.0-beta.53` to `7.0.0-beta.54`
-   [@​babel/plugin-proposal-class-properties](https://github.com/babel/babel) (`devDependencies`): from `7.0.0-beta.53` to `7.0.0-beta.54`
-   [@​babel/core](https://github.com/babel/babel) (`devDependencies`): from `7.0.0-beta.53` to `7.0.0-beta.54`

# Release Notes
<details>
<summary>babel/babel</summary>

### [`v7.0.0-beta.54`](https://github.com/babel/babel/releases/v7.0.0-beta.54)
[Compare Source](babel/babel@v7.0.0-beta.53...v7.0.0-beta.54)
#### v7.0.0-beta.54 (2018-07-16)

> Regarding `babel/babel#8184, we aren't using `micromatch` for paths, just basic `*/**` substitution now. For anything more complicated we will recommend using a regex/.js config.
> There was a bug in the stage presets (`babel/babel#8307), so we just removed the requirements for setting options in the meantime for ease of use. We are removing the Stage presets next anyway. `babel/babel#8293
##### 馃挜 Breaking Change
* `babel-core`, `babel-register`, `babel-traverse`
  * [#&#8203;8327](`babel/babel#8327) Treat string ignore/only/test/include/exclude values as paths with only basic pattern matching. ([@&#8203;loganfsmyth])
##### 馃悰 Bug Fix
* `babel-core`, `babel-register`, `babel-traverse`
  * [#&#8203;8327](`babel/babel#8327) Treat string ignore/only/test/include/exclude values as paths with only basic pattern matching. ([@&#8203;loganfsmyth])
* `babel-preset-stage-0`, `babel-preset-stage-1`
  * [#&#8203;8317](`babel/babel#8317) Fix stage-0/1 import of pipeline proposals array. ([@&#8203;mAAdhaTTah])
* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
  * [#&#8203;8316](`babel/babel#8316) Ensure that the wildcard interop is used with re-export + default.. ([@&#8203;loganfsmyth])
* `babel-core`
  * [#&#8203;8315](`babel/babel#8315) Remove option-filtering options from the final options results.. ([@&#8203;loganfsmyth])
##### 馃摑 Documentation
* [#&#8203;8320](`babel/babel#8320) Add link to audio version of song. ([@&#8203;rugk])
##### Committers: 4
- Daniel Tschinder ([danez])
- James DiGioia ([mAAdhaTTah])
- Logan Smyth ([loganfsmyth])
- rugk ([rugk])

---


</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).

@hzoo hzoo force-pushed the rm-stage-presets branch from 64673ae to 48fe688 Jul 21, 2018

@hzoo hzoo added the Priority: High label Jul 21, 2018

```json
{
"plugins": [
// Stage 0

This comment has been minimized.

@xtuc

xtuc Jul 23, 2018

Member

Comments in JSON are not valid, could we remove them? (because user will need to) or can we switch to js?

Following READMEs too

This comment has been minimized.

@nicolo-ribaudo

nicolo-ribaudo Jul 23, 2018

Member

.babelrc uses Json5, so comments work.

@@ -66,6 +66,7 @@ yarn add ${name} --dev

packages
.filter(x => x !== "README.md") // ignore root readme
.filter(x => x.indexOf("babel-preset-stage-") === -1) // ignore stages

This comment has been minimized.

@xtuc

xtuc Jul 23, 2018

Member

This seems obscure to me. I would prefer using a rejection list which explicitly exclude: ['babel-preset-stage-0', 'babel-preset-stage-1', 'babel-preset-stage-2']

This comment has been minimized.

@hzoo

hzoo Jul 23, 2018

Member

That's fine but just FYI this is a temporary change because we are going to not publish any more of the package anyway so I would remove this code the next release after.

@xtuc

This comment has been minimized.

Copy link
Member

xtuc commented Jul 23, 2018

Could we also remove the stage plugins from the REPL? I think that the possibility of loading plugins from npm would suffice? IRC parser flags were not pushed, we might need to fix that first.

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Jul 23, 2018

Removing from repl isn't part of this PR since I left it in babel-standalone so we are leaving it for now? Yeah would like to figure out how we want to go about doing that. Don't have a good solution and is simple to do atm. I think the use case for the repl is different since it's fine to just allow any syntax mostly and we can easily keep it up to date since it's just for testing

@mAAdhaTTah

This comment has been minimized.

Copy link
Contributor

mAAdhaTTah commented Jul 23, 2018

It might be confusing for people to find presets on the repl that don't exist / shouldn't be used anymore.

@hzoo

This comment has been minimized.

Copy link
Member

hzoo commented Jul 23, 2018

I think that's fine, this is only for v7 while we are figuring out what to do there. We have the same problem with loose mode, plugin options.

@hzoo hzoo merged commit c70a32a into master Jul 24, 2018

5 checks passed

babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 80.39% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@xtuc xtuc deleted the rm-stage-presets branch Jul 24, 2018

@nicolo-ribaudo nicolo-ribaudo referenced this pull request Jul 24, 2018

Merged

Remove stage presets #69

hzoo added a commit to babel/babel-upgrade that referenced this pull request Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment