<commit_before>jspm 2.0 Private Alpha
===

> Thank you for trying out jspm 2, and giving your feedback!
> This is a private experimental alpha release, so please keep all feedback to the issue queue here or other private channels.

## The What, Why and How

The concept of jspm is the concept of a workflow for JavaScript based on:

* Installing dependencies
* Easily executing those dependencies, without a build or further configuration, in both the browser and Node
* Providing workflows for production optimizations on projects, both for building whole applications and libraries.

The key concept being that the package manager, ecosystem and linker are all heavily entwined and have to exist together
to ensure these smooth workflows.

The first version got caught up in SystemJS as the spec for JS execution, and failed the moment the loader spec got derailed.

This version aims to realign with `<script type="module">`, modules in NodeJS and dynamic `import()` workflows.

The way modules are loaded is designed to exactly match the way modules load in NodeJS as this set the ecosystem conventions, with two main extensions:

1. We support loading from `jspm_packages` using a `jspm.json` lockfile read by the resolver itself, falling back to `node_modules` lookup when a package is not found.
2. We support the `package.json` `"esm": true` flag for enabling `.js` extensions for ES modules (spec proposal for NodeJS at https://github.com/nodejs/node-eps/pull/60)

The aim is to build and extend on shared community conventions, to ensure convention based workflows. Edge cases have to
all work out over a large ecosystem, so great care is taken to exactly support Node module resolution in all its edge cases,
while extending it.

The benefit of `jspm_packages` is that we can symlink all `jspm_packages/pkg@version` folders so we can reduce the size overhead of package installs considerably. In addition it is very useful for browser serving and caching.

From this base, we then provide execution in NodeJS, execution in the browser, and build support on these conventions.

Follow the quickstart below for the exact workflows here.

## jspm 2.0 Release Checklist

The following items are still outstanding for the release:

**Package Manager**
- [x] Scoped package dependency support
- [ ] Peer dependencies
- [ ] Support package.json scripts and bins
- [ ] Package manager script hooks
- [ ] `jspm init` workflow

**Browser Server**
- [ ] `--production` flag support

**Build**
- [ ] Source maps debugging
- [ ] `--minify` option for builds
- [ ] Allow custom chunking options
- [ ] Support sther standard options (`--banner`, `--skip-source-maps`, `--global-defs`, `--global-name` for global, umd outputs)

## jspm 2.0 Alpha Quickstart

1. [Install jspm 2.0 alpha](#1-install-jspm-20-alpha)
1. [Create a Project](#2-create-a-project)
1. [Install Dependencies](#3-install-dependencies)
1. [Execution in NodeJS](#4-execution-in-nodejs)
1. [Execution in the Browser](#5-execution-in-the-browser)
1. [Building for NodeJS](#6-building-for-nodejs)
1. [Dynamic Import Support](#7-dynamic-import-support)
1. [Building for the Browser](#8-building-for-the-browser)
1. [Automated Chunked Builds](#9-automated-chunked-builds)
1. [Building for Legacy Browsers](#10-building-for-legacy-browsers)

### 1. Install jspm 2.0 alpha

Make sure your GitHub SSH keys are configured correctly then:

```
npm install -g git+ssh://git@github.com/jspm/jspm2-cli#2.0
```

Also make sure to run NodeJS 8.9.0 or greater.

### 1. Create a Project

`jspm init` is still in development for now, so create a new project manually:

```
mkdir jspm-test
cd jspm-test
echo '{ "esm": true }' > package.json
```

### 2. Install Dependencies

As expected:

```
jspm install react react-dom lodash babel-core
```

Note peer dependencies are not yet quite properly implemented, so will give some warnings, but it will work out fine.

> Great care has been taken to make installs run really fast, as part of the package manager wars :)
> There's also support for `install --offline` and `install --prefer-offline` as expected these days!

### 3. Execution in NodeJS

test.js
```js
import clone from 'lodash/clone';

console.log(clone({ a: 'b' }));
```

```
jspm run test.js
```

When executing jspm is using the NodeJS `--experimental-modules` feature directly, configuring the jspm resolver through
the NodeJS `--loader` hooks so this is full native module support.

### 4. Execution in the Browser
<commit_msg>readme updates<commit_after>jspm 2.0 Private Alpha
===

> Thank you for trying out jspm 2, and giving your feedback!
> This is a private experimental alpha release, so please keep all feedback to the issue queue here or other private channels.

## The What, Why and How

The concept of jspm is the concept of a workflow for JavaScript based on:

* Installing dependencies
* Easily executing those dependencies, without a build or further configuration, in both the browser and Node
* Providing workflows for production optimizations on projects, both for building whole applications and libraries.

The key concept being that the package manager, ecosystem and linker are all heavily entwined and have to exist together
to ensure these smooth workflows.

The first version got caught up in SystemJS as the spec for JS execution, and failed the moment the loader spec got derailed.

This version aims to realign with `<script type="module">`, modules in NodeJS and dynamic `import()` workflows.

The way modules are loaded is designed to exactly match the way modules load in NodeJS as this set the ecosystem conventions, with two main extensions:

1. We support loading from `jspm_packages` using a `jspm.json` lockfile read by the resolver itself, falling back to `node_modules` lookup when a package is not found.
2. We support the `package.json` `"esm": true` flag for enabling `.js` extensions for ES modules (spec proposal for NodeJS at https://github.com/nodejs/node-eps/pull/60)

The aim is to build and extend on shared community conventions, to ensure convention based workflows. Edge cases have to
all work out over a large ecosystem, so great care is taken to exactly support Node module resolution in all its edge cases,
while extending it.

The benefit of `jspm_packages` is that we can symlink all `jspm_packages/pkg@version` folders so we can reduce the size overhead of package installs considerably. In addition it is very useful for browser serving and caching.

From this base, we then provide execution in NodeJS, execution in the browser, and build support on these conventions.

Follow the quickstart below for the exact workflows here.

## jspm 2.0 Release Checklist

The following items are still outstanding for the release:

**Package Manager**
- [x] Scoped package dependency support
- [ ] Peer dependencies
- [ ] Support package.json scripts and bins
- [ ] `jspm init` workflow

**Build**
- [x] Source maps debugging
- [ ] `--minify` option for builds

## jspm 2.0 Alpha Quickstart

1. [Install jspm 2.0 alpha](#1-install-jspm-20-alpha)
1. [Create a Project](#2-create-a-project)
1. [Install Dependencies](#3-install-dependencies)
1. [Execution in NodeJS](#4-execution-in-nodejs)
1. [Execution in the Browser](#5-execution-in-the-browser)
1. [Building for NodeJS](#6-building-for-nodejs)
1. [Dynamic Import Support](#7-dynamic-import-support)
1. [Building for the Browser](#8-building-for-the-browser)
1. [Automated Chunked Builds](#9-automated-chunked-builds)
1. [Building for Legacy Browsers](#10-building-for-legacy-browsers)

### 1. Install jspm 2.0 alpha

Make sure your GitHub SSH keys are configured correctly then:

```
npm install -g git+ssh://git@github.com/jspm/jspm2-cli#2.0
```

Also make sure to run NodeJS 8.9.0 or greater.

### 1. Create a Project

`jspm init` is still in development for now, so create a new project manually:

```
mkdir jspm-test
cd jspm-test
echo '{ "esm": true }' > package.json
```

### 2. Install Dependencies

As expected:

```
jspm install react react-dom lodash babel-core
```

Note peer dependencies are not yet quite properly implemented, so will give some warnings, but it will work out fine.

> Great care has been taken to make installs run really fast, as part of the package manager wars :)
> There's also support for `install --offline` and `install --prefer-offline` as expected these days!

### 3. Execution in NodeJS

test.js
```js
import clone from 'lodash/clone';

console.log(clone({ a: 'b' }));
```

```
jspm node test.js
```

When executing jspm is using the NodeJS `--experimental-modules` feature directly, configuring the jspm resolver through
the NodeJS `--loader` hooks so this is full native module support.

### 4. Execution in the Browser

{'fraction_non_alphanumeric': 0.0878541117100585, 'fraction_numerical': 0.011239821080399129, 'mean_word_length': 4.379395434916718, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6730149', 'n_tokens_mistral': 2558, 'n_tokens_neox': 2410, 'n_words': 1185}