Coder Social home page Coder Social logo

bit-loader's People

Contributors

gitter-badger avatar greenkeeper[bot] avatar mark-simulacrum avatar miguelcastillo avatar nucliweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bit-loader's Issues

Add a pre-compile stage that executes after the dependency stage executes

Currently, plugin authors depend on the dependency stage to execute anything that has to happen after all the transforms have executed. But using the dependency isn't as semantically correct for generating exports. So to make the plugin language a bit more accurate, adding a precompile stage will help. This stage is async and will run in the loading phase.

allows plugins to process other plugin when loaded dynamically

The issue with this is that if we allow plugins to process other plugins when they dynamically loaded, we are going to get deadlocks.

For example, the following sequence of plugins will cause a deadlock because the first plugin will depend on the second one to load, and the second one depends on the first to load.

P1 -> P2.

Deadlock: P1 triggers P2 to load so that P1 can be processed by P2. When P1 is loading P2, P2 then needs to load P1 so that P2 can be processed by P1. This is a deadlock...

So, we should only do forward processing. Meaning, P1 can load P2 so that P2 can process P1, but P2 cannot load P1 so that P1 can process P2. This approach is a bit fragile because users will need to be aware of this. Ultimately, we completely block plugins from processing other plugins by automatically adding dynamic plugins to the ignore list.

Allow transforms to define dependencies on other transforms

Add a way to define a transformation where other transformation execute in a particular order before the transformation itself is executed.

Similar to gulp tasks:

gulp.task('x', ['a', 'b'], function() {
  // do something
});

Here we have a task called x that before it is executed, a and b are executed. Only then will the callback get called. The callback is optional so that a simple chain of transforms can just be executed.

automatically add dynamic plugins to the ignore list

adding dynamic plugins to the ignore list will prevent plugins form processing other plugins. We want to block this so that plugin author and users of plugins don't have to worry about the intricacies steaming from plugin deadlocks as described here #127

If plugins are just not processed, then plugin author simply gotta make sure they pre process and bundle their stuff up, and that's what bit loader will use.

Move `fetch` out of the pipeline

This is to enable putting meta modules through the transformation pipeline without forcing the module source to be fetched first.

Use case - Enable a site that shows input and output from the transformation process

change moduleParent to module referer string

moduleParent is supposed to be a Module.Meta object, but its a mutable it's not reliable. So, switching to using a referer to provide a way to specify the parent module path is more specific and less ambiguous.

Define a ModuleMeta factory process in loader core

Currently, module meta objects are VERY lose objects and get verified when they get put through the loader pipeline, which is really late. Creating a factory will move any format inconsistencies to immediate failures rather than delayed failures.

Allow module meta objects to define what transformations to be applied on them

This relates to #16, where creating transformation dependencies can be used to leverage to define transformations that need to be executed. And the other part is leveraging plugins in a module meta object to define what tasks run against them.

for example,

loader.transform.use("test", ["a", "b"]);

loader.import("test!something", function(something) {
   console.log('executed transform "test", which basically is running "a" and "b"');
});

When module something is loaded, the transformation test is executed on it.

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.