Skip to content

Commit

Permalink
Rename Parcel Redux to Pax
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan committed May 13, 2018
1 parent 92196bf commit ae70ce4
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,5 +1,5 @@
[workspace]
members = ["esparse", "parcel"]
members = ["esparse", "pax"]

[profile.release]
lto = true
46 changes: 23 additions & 23 deletions README.md
@@ -1,4 +1,4 @@
# Parcel Redux
# Pax

The fastest JavaScript bundler in the galaxy. Fully supports ECMAScript module syntax (`import`/`export`) in addition to CommonJS `require(<string>)`.

Expand All @@ -20,18 +20,18 @@ You wait a few seconds, hit <kbd>⌘R</kbd> again, and your changes finally show

Rinse. Repeat. Ten cycles later, things are working again. You've succeeded. It's time to `git commit`. But you spent **more time waiting than working**. And it's your bundler's fault.

Parcel Redux is a bundler. But you'll never beat it. Why?
Pax is a bundler. But you'll never beat it. Why?

- It knows exactly enough about JavaScript to handle dependency resolution. It doesn't even bother parsing most of your source code.
- It's fully parallelized, so it can make the most of your cores.
- It's minimal. It doesn't support plugins
- It's minimal. It doesn't support plugins or

Don't waste time waiting for your bundler to do its thing. Use Parcel Redux while you're developing, and **iterate to your heart's content**. Use your super-cool, magical, slow-as-molasses bundler for releases, when you don't care how long it takes to run.
Don't waste time waiting for your bundler to do its thing. Use Pax while you're developing, and **iterate to your heart's content**. Use your super-cool, magical, slow-as-molasses bundler for releases, when you don't care how long it takes to run.

# How do I get it?

```sh
> cargo install parcel
> cargo install pax
```

If you don't have `cargo`, install it with [https://rustup.rs](https://rustup.rs/).
Expand All @@ -49,26 +49,26 @@ exports.square = x => x * x
```

```sh
> parcel index.js parcel.js
> pax index.js bundle.js
```

And then `node parcel.js` or `<script src=parcel.js>` to your heart's content.
Slap on a `<script src=bundle.js>`, and you're ready to go.

# Does it do source maps?

Of course!

```sh
# parcel.js and parcel.js.map
> parcel index.js parcel.js
# bundle.js and bundle.js.map
> pax index.js bundle.js

# parcel.js with inline map
> parcel --map-inline index.js parcel.js
# bundle.js with inline map
> pax --map-inline index.js bundle.js

# parcel.js with no source map
> parcel index.js >parcel.js
# bundle.js with no source map
> pax index.js >bundle.js
# or
> parcel --no-map index.js parcel.js
> pax --no-map index.js bundle.js
```

# Modules?
Expand All @@ -88,20 +88,20 @@ export const square = x => x * x, cube = x => x * x * x
```

```
> parcel -e index.mjs parcel.js
> pax -e index.mjs bundle.js
```

If you need your modules to be in `.js` files for some reason, use `-E` (`--es-syntax-everywhere`) instead of `-e` (`--es-syntax`).

# What are the options?

```
> parcel --help
parcel v0.1.2
> pax --help
pax v0.1.2
Usage:
parcel [options] <input> [output]
parcel [-h | --help]
pax [options] <input> [output]
pax [-h | --help]
Options:
-i, --input <input>
Expand Down Expand Up @@ -169,7 +169,7 @@ sys 0m0.031s
real 0m0.373s
user 0m0.324s
sys 0m0.051s
> time parcel-redux index.js >parcel.js
> time pax index.js >bundle.js
real 0m0.010s
user 0m0.005s
sys 0m0.006s
Expand All @@ -179,7 +179,7 @@ sys 0m0.006s
real 0m2.385s
user 0m2.459s
sys 0m0.416s
> time parcel-redux src/main.js >parcel.js
> time pax src/main.js >bundle.js
real 0m0.037s
user 0m0.071s
sys 0m0.019s
Expand All @@ -189,13 +189,13 @@ sys 0m0.019s
real 0m3.142s
user 0m3.060s
sys 0m0.483s
> time parcel-redux src/main.js parcel.js
> time pax src/main.js bundle.js
real 0m0.046s
user 0m0.077s
sys 0m0.026s

# realtime!
> parcel-redux -w examples/simple bundle.js
> pax -w examples/simple bundle.js
ready in 2 ms
generate bundle.js in 2 ms
generate bundle.js in 2 ms
Expand Down
2 changes: 1 addition & 1 deletion esparse/Cargo.toml
Expand Up @@ -5,7 +5,7 @@ authors = ["Nathan"]

description = "A fast JavaScript parser. Currently only a lexical analyzer."
documentation = "https://docs.rs/esparse"
repository = "https://github.com/nathan/parcel-redux"
repository = "https://github.com/nathan/pax"
license = "MIT"

keywords = ["js", "javascript", "es", "ecmascript", "parser"]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions parcel/Cargo.toml → pax/Cargo.toml
@@ -1,10 +1,10 @@
[package]
name = "parcel"
name = "pax"
version = "0.1.2"
authors = ["Nathan"]

description = "The fastest JavaScript bundler around."
repository = "https://github.com/nathan/parcel-redux"
repository = "https://github.com/nathan/pax"
license = "MIT"
readme = "../README.md"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions parcel/src/head.js → pax/src/head.js
@@ -1,12 +1,12 @@
~function(global) {
const Parcel = {}
Parcel.baseRequire = typeof require !== "undefined" ? require : n => {
const Pax = {}
Pax.baseRequire = typeof require !== "undefined" ? require : n => {
throw new Error(`Could not resolve module name: ${n}`)
}
Parcel.modules = {}
Parcel.files = {}
Parcel.mains = {}
Parcel.resolve = (base, then) => {
Pax.modules = {}
Pax.files = {}
Pax.mains = {}
Pax.resolve = (base, then) => {
base = base.split('/')
base.shift()
for (const p of then.split('/')) {
Expand All @@ -15,15 +15,15 @@
}
return '/' + base.join('/')
}
Parcel.Module = function Module(filename, parent) {
Pax.Module = function Module(filename, parent) {
this.filename = filename
this.id = filename
this.loaded = false
this.parent = parent
this.children = []
this.exports = {}
}
Parcel.makeRequire = self => {
Pax.makeRequire = self => {
const require = m => require._module(m).exports
require._deps = {}
require.main = self
Expand All @@ -35,16 +35,16 @@
}
}
require._module = m => {
let fn = self ? require._deps[m] : Parcel.main
let fn = self ? require._deps[m] : Pax.main
if (fn == null) {
const module = {exports: Parcel.baseRequire(m)}
const module = {exports: Pax.baseRequire(m)}
require._deps[m] = {module: module}
return module
}
if (fn.module) return fn.module
const module = new Parcel.Module(fn.filename, self)
const module = new Pax.Module(fn.filename, self)
fn.module = module
module.require = Parcel.makeRequire(module)
module.require = Pax.makeRequire(module)
module.require._deps = fn.deps
module.require.main = self ? self.require.main : module
if (self) self.children.push(module)
Expand Down
6 changes: 3 additions & 3 deletions parcel/src/main.rs → pax/src/main.rs
Expand Up @@ -94,7 +94,7 @@ impl<'a, 'b> Writer<'a, 'b> {
w.write_all(HEAD_JS.as_bytes())?;
// for (module, main) in self.mains {
// write!(w,
// "\n Parcel.mains[{mod_path}] = {main_path}",
// "\n Pax.mains[{mod_path}] = {main_path}",
// mod_path = Self::js_path(&module),
// main_path = Self::js_path(&main),
// );
Expand All @@ -106,7 +106,7 @@ impl<'a, 'b> Writer<'a, 'b> {
let filename = Self::js_path(&file);

write!(w,
"\n Parcel.files[{filename}] = {id}; {id}.deps = {deps}; {id}.filename = {filename}; function {id}(module, exports, require) {{\n",
"\n Pax.files[{filename}] = {id}; {id}.deps = {deps}; {id}.filename = {filename}; function {id}(module, exports, require) {{\n",
filename = filename,
id = id,
deps = deps,
Expand All @@ -126,7 +126,7 @@ impl<'a, 'b> Writer<'a, 'b> {
}
let main = Self::name_path(self.entry_point);
write!(w,
"\n Parcel.main = {main}; Parcel.makeRequire(null)()\n if (typeof module !== 'undefined') module.exports = Parcel.main.module && Parcel.main.module.exports\n",
"\n Pax.main = {main}; Pax.makeRequire(null)()\n if (typeof module !== 'undefined') module.exports = Pax.main.module && Pax.main.module.exports\n",
main = main,
)?;
w.write_all(TAIL_JS.as_bytes())?;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ae70ce4

Please sign in to comment.