Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.
This repository was archived by the owner on May 28, 2019. It is now read-only.

Modularize internals; use a bundler to generate the resulting source file #75

Description

The source is currently delivered as a single monolithic blob, with a giant runInContext function. This makes it difficult to follow what we're exporting, and tangles up internal state in each function.

It also means we can't break up JSON 3 into custom builds—i.e., just the date serialization fixes, stringify only, parse only, or including a subset of the feature tests. (This isn't nearly as important as for a general-purpose library like jQuery or lodash, but it's still painful to download ~4 KB of dead code). This might also make it easier for the Closure Compiler to prune unused code paths.

The feature/webpack branch is my first cut at making this happen—break up the internals, then use a builder like webpack (or Browserify) to stitch them together. We'll need to rework our exports system, but there are modules for adding AMD and global wrappers that we could use.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions