Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

New way to handle packaging #181

@amccollum

Description

@amccollum

Ok, so I've updated my previous changeset that implements a new Module class at runtime. The changes fall across 7 different modules:

  • Ender
  • ender-args-parser
  • ender-builder
  • ender-dependency-graph
  • ender-package-util
  • ender-js
  • ender-commonjs

Each of the above has a new-packaging branch that includes the changes. The changes in most of the modules are fairly minor, with the lion's share of the changes coming in the ender-builder package in ender-js/ender-builder@4439aee

That commit is huge, so I've tried to comment on some of the larger changes inline to explain what's going on.

It's also worth looking at the new ender-commonjs module, which defines the new way packages are created using a Module class at runtime.

Here's a short summary what these changes bring:

  • New Module object at runtime, supporting multi-file modules, internal/relative requires, requiring submodules, and better CommonJS compatibility
  • Separated the CommonJS client lib from the Ender core
  • Broken out assembly process, allowing for more control over the final build, or possibly replacing CommonJS with other package formats
  • However, to better support CommonJS semantics, this change removes support for using an array of files for the main or bridge, the fix being to either use internal requires to mimic this behavior, or force packages to do their own concatenation

I updated all the current tests to work with these changes, but I haven't gotten around to writing tests for the new assemble.js file, yet. This leaves some holes in the test coverage, mainly around the specific content of the final build. It may take me a little while to get around to this, but I wanted to get the rest of the changes out for comment while I finished up the tests. There may be other bugs as well.

@rvagg, I'd love to hear your thoughts in particular, because I know you were a bit skeptical of some of these changes when I submitted them before.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/969742-new-way-to-handle-packaging?utm_campaign=plugin&utm_content=tracker%2F165667&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F165667&utm_medium=issues&utm_source=github).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions