GithubHelp home page GithubHelp logo

babel / website Goto Github PK

View Code? Open in Web Editor NEW
740.0 45.0 1.3K 30.58 MB

:globe_with_meridians: The Babel documentation website

Home Page: https://babeljs.io/docs/en/index.html

License: MIT License

CSS 8.30% JavaScript 34.87% TypeScript 50.06% Shell 0.12% HTML 6.65%
babel documentation javascript docs website

website's Introduction

This is the source for the babeljs.io website; feel free to suggest changes to our docs!

Setup

Node: Check that Node is installed with version 10.19.0 and up. You can check this with node -v.

Yarn: Make sure that Yarn 1 is installed with version >= 1.19.0.

$ git clone [email protected]:babel/website.git
$ cd website
$ yarn && yarn bootstrap
  • Just run yarn start next time (check the package.json for scripts).

Contributing to the website

To keep documentation in sync across all of Babel's packages, the docs are now directly located in this repository. The READMEs in babel/babel are auto generated and point to this documentation.

You might want to make yourself familiar with docusaurus to make significant changes to the website.

Looking for support?

For questions and support on contributing please join our Slack community, channel #website or directly here.

website's People

Contributors

andarist avatar bvaughn avatar callumlocke avatar coderaiser avatar cvrebert avatar danez avatar daniel15 avatar dependabot[bot] avatar eventualbuddha avatar existentialism avatar hzoo avatar jamiebuilds avatar jlhwung avatar jridgewell avatar liuxingbaoyu avatar loganfsmyth avatar microbouji avatar nicolo-ribaudo avatar prathamesh-sonpatki avatar qc-l avatar raspo avatar saravieira avatar sebmck avatar sosukesuzuki avatar sparty02 avatar strml avatar vikr01 avatar xtuc avatar yavorsky avatar zloirock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Docs: Using Modules

Details about bundling modules with browserify/webpack/etc. ie. modules: system only transpiles to the system.js syntax but doesn't bundle them with system.js

REPL: Examples

Previous there was a dropdown where you could select a bunch of ES6 examples and insert them into the console, although I never finished it and removed it so I could release the new site.

REPL: Improve REPL State Management

Currently, the REPL saves its state as an encoded URI in the address bar URL. This has several drawbacks including things like tricky escaping (i.e. #44) and unfriendly URLs (i.e. #162).

The goal of this enhancement is to leverage an external store for saving REPL state, if desired. Some requirements:

  • URLs for saved REPL sessions should be friendly/short, for easy sharing.
  • Persistence should be opt-in (i.e. every REPL session doesn't need to be saved somewhere)
  • The persistence of state should be throttled, either by debouncing input or by explicitly asking the user to click a button to 'Save' the REPL state, useful for sharing or returning to at a later time.
  • Consider how this ties into local storage persistence (implemented via #77).

Non requirements/goals:

  • Private persistence (i.e. only certain users can access REPL sessions). That is way overboard right now.

Some ideas:

  • Use the GitHub Gists API to persist REPL input.
  • Use the JS Bin API to persist REPL input.

3.0.0

  • Publish to npm
  • Update website
  • Upgrade plugins
    • webpack
    • jest
    • ember-cli
    • broccoli
    • metalsmith
    • gulp
    • gobble
    • brunch
    • browserify
    • karma
    • duo
    • grunt
    • jade
    • connect
    • rails

Don't collapse the sidebar

It's weird to have the sidebar constantly opening and closing when you're scrolling and it makes it awkward to select items.

Docs: Resources page

We should begin collecting third party blog posts/meetup videos/etc. about both ES6 and 6to5.

REPL log output is not displayed when inside async function

Odd.
It seems the console.log is being ignored by the REPL output when we call it inside an async function.
I took too long to figure out the code was working but just was not displaying the log in the REPL.
In the browser dev tools it works well, i mean, the log appear.

The code i was trying:

function p1() {
  return new Promise(function(resolve, reject){
    setTimeout(function() {
      resolve('p1');
    }, 300);
  });
}

async function getVal() {
  var val1 = await p1();
  return val1;
}

(async function() {
  var bla = await getVal();
  console.log(bla); 
}());

screenshot from 2015-01-07 11 44 00

REPL: Add support for all Babel options

It'd be nice to have a dropdown or something that allowed you to toggle all the options for 6to5. It'd be even nicer if it was auto generated from the latest 6to5.

"no runtime"?

The 6to5 site states:

Maps directly to the equivalent ES5 with no runtime

What does "no runtime" mean in this context? When I use ES6 class syntax I get a few extra helpers in the generated code:

var _get = function get(object, property, receiver) {
  var desc = Object.getOwnPropertyDescriptor(object, property);

  if (desc === undefined) {
    var parent = Object.getPrototypeOf(object);

    if (parent === null) {
      return undefined;
    } else {
      return get(parent, property, receiver);
    }
  } else if ("value" in desc && desc.writable) {
    return desc.value;
  } else {
    var getter = desc.get;
    if (getter === undefined) {
      return undefined;
    }
    return getter.call(receiver);
  }
};

var _inherits = function (subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      enumerable: false,
      writable: true,
      configurable: true
    }
  });
  if (superClass) subClass.__proto__ = superClass;
};

var _prototypeProperties = function (child, staticProps, instanceProps) {
  if (staticProps) Object.defineProperties(child, staticProps);
  if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

Admittedly this is a very small amount of extra code, but is that code not considered a "runtime"? If not, what would you consider to be a runtime? Do you mean some actual sort of VM?

favicon

Needs to have a favicon, as this isn't great:

2015-01-07 at 7 54 am

Compare: Move React / JSX to new section

Having React and JSX in the "Language Support" section seems weird. Mainly since everything else is new JS features it seems like a cheap shot at the other transpilers because supporting react/jsx is unique to 6to5.

Perhaps a new section could be added where this could go. I'm don't really have a name in mind.

IE8 Support

6to5 supports IE8 for most things, but our website doesn't and I don't think it would be difficult to.

REPL output doesn't match command line output

Given this code:

class User extends Model {
  constructor() {
    super();
    this.sayHello();
  }

  sayHello() {
    alert("Hello World!");
  }
}

The REPL should produce:

var User = function User() {
  Model.call(this);
  this.sayHello();
};

_inherits(User, Model);

User.prototype.sayHello = function () {
  alert("Hello World!");
};

It actually produces:

var User = (function (Model) {
  function User() {
    _get(Object.getPrototypeOf(User.prototype), "constructor", this).call(this);
    this.sayHello();
  }

  _inherits(User, Model);

  _prototypeProperties(User, null, {
    sayHello: {
      value: function () {
        alert("Hello World!");
      },
      writable: true,
      enumerable: true,
      configurable: true
    }
  });

  return User;
})(Model);

REPL: Include Source Maps?

Thought: Including source maps in the transpiled REPL output would allow browser debugging through the ES6 (REPL input) vs ES5 (REPL output) code.

Better selfContained docs

Document the need for a module bundler, webpack, browserify etc and provide details on installing 6to5-runtime.

Fix readable code example on homepage

The current readable example of

class User extends Model {
  constructor() {
    super();
    this.sayHello();
  }

  sayHello() {
    alert("Hello World!");
  }
}

to

var User = function User() {
  Model.call(this);
  this.sayHello();
};

_inherits(User, Model);

User.prototype.sayHello = function () {
  alert("Hello World!");
};

is hilariously out of date.

Is 6-to-library worth spreading the word?

Hello,

I wrote the formatter 6-to-library. Do you think it's worth a mention somewhere in the docs?

Why?

I wanted to author in ES6, and still deliver a seamless experience to users today. The UMD formatter does its job well. But it has no support for simple globals, and always exports exports by name. I wanted to avoid the need for explicitly saying require('a-library').default when only the default key is exported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.