GithubHelp home page GithubHelp logo

brigade's People

Contributors

benjamn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

petehunt

brigade's Issues

Alternate schema syntax: list of root identifiers

In practice, it turns out that a schema tree can be repetitive and awkward to write down.

Suppose we specified the tree as a list of roots instead:

['a', 'b', 'c']

What I mean to capture here is that any subset of the bundle root modules in the list could be included on a given page (including the empty set), but (because the order of bundles is not important) the order in which they appear will always follow the listed order.

Here's how we might have expressed this set of possibilities as a schema tree:

{
  "a": {
    "b": {
      "c": {}
    },
    "c": {}
  },
  "b": {
    "c": {}
  },
  "c": {}
}

I claim that schema trees always need to have such a structure for maximum flexibility, and so a list of roots should be sufficient to express all desired schema trees.

The only drawback is that the schema tree gets large with many roots. How large? For n roots, the tree would have 2^n-1 keys.

Investigate (benign?) bundle writing race condition

I've noticed seemingly identical bundles getting written multiple times. This kind of thing is prevented from run to run by the file existence check in BundleWriter.writeP, but might not be adequately guarded against during the same run.

Make module wrapping configurable

For backwards compatibility, the install("module/id",function(require,exports,module){...}) syntax has to remain the default, but it makes it much easier to interface with other build tools if that default can be overridden.

Plan: add a --wrapper option to the CLI interface that names a module that module.exports = some function that takes the id and source of each module as arguments.

Prefix bundle filenames with root module identifier slug for greater scrutability

For instance, instead of bundling tests/login as 76bfa5a904beec3d69a3f942d7e534bfaaad8b4d.js, call it something like

tests_login.76bfa5a904beec3d69a3f942d7e534bfaaad8b4d.js

The hex digest part will still disambiguate the file perfectly well, and the new filenames won't be any more guessable than the pure hex filenames.

It's just really annoying to have to guess which bundle is which when you're inspecting the DOM.

Handle false positive dependencies more gracefully

Sometimes a module will not be found because the require statement that indicated it as a dependency appeared in a comment or some dead code.

There should be a warning when this happens, and a dummy module should be installed, but this kind of error should not be fatal.

Handle empty bundles better

A bundle can end up empty if its ancestors have already included everything the empty bundle needed.

It should be possible to avoid making a request for an empty bundle. The tree entry for the empty bundle should probably have an "empty": True property. If the consumer of the tree chooses to ignore it, it's not the end of the world.

Don't let UglifyJS mangle the `require` identifier

We don't currently know whether UglifyJS is going to be used when modules are wrapped, so it's not trivial to wrap them differently.

There may be a way to cope with require mangling, but it would probably require cooperation with the install module.

Preserving require seems like the simplest approach for now.

Generate a structured tree of pure CommonJS modules as a build artifact

These files should be compatible with Node's require function, and consumable by require.js or whatever else.

For simplicity, the module root should just be the same directory provided by --output-dir.

Should it be possible to suppress the bundle output if all you want is the directory structure of modules?

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.