GithubHelp home page GithubHelp logo

Comments (20)

moonglum avatar moonglum commented on July 20, 2024 1

I was way too tired.

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

I don't understand where we get the bucket from?

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

plugins should (optionally) determine bucket […] themselves

It seems highly unlikely that the choice of bucket might reasonably be user- or project-specific.

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

I agree. But does the plugin expose its bucket type?

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

excuse me?

I don't know what that means, exactly.

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

Ok, again: Currently, we store the info of "which pipeline is in which bucket" here: https://github.com/faucet-pipeline/faucet-pipeline-core/blob/master/lib/index.js#L9-L25

Where will we store it in the future? Gimme some code.

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

Right now, a plugin looks like this:

module.exports = (config, assetManager, { browsers, compact, sourcemaps } = {}) => {
    
    return filepaths => Promise.all();
};

They might also export an object which includes their preferred bucket:

exports.bucket = "scripts";
exports.plugin = () => ;

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

Ok, makes sense. Let's do this 👍

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

For backwards compatibility (that is, so plugins work with faucet-core v1.x as well as v2.0), we might instead attach the bucket property to the function - that's a bit awkward though, so perhaps not worth worrying about?

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

No. We have control over all plug ins, and by publishing this as 2.0 we mark it as a breaking change.

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

Just playing devil's advocate here: What if someone updates faucet-sass to v2.0 but, for whatever reason, faucet-static stays at v1.0 (cf. faucet-js instructions)?

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

Shouldn't this be a version conflict, because faucet-static expects a version < 2.0?

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

AIUI npm would create node_modules/faucet-pipeline-static/node_modules/faucet-pipeline-core alongside node_modules/faucet-pipeline-core - which doesn't work for faucet though because there's a single (i.e. shared) entry point with node_modules/.bin/faucet.

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

As discussed, we will try to make this a non-breaking change

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

Actually, the proposal above just addresses plugin and bucket, not the configuration key though.

    js: {
        plugin: "faucet-pipeline-js",
        bucket: "scripts"    
    }

Thus in order to activate a custom plugin, users' configuration would look like this:

    foo: ,
    plugins: {
        foo: "faucet-pipeline-foo"
    }

This might be further simplified:

    foo: ,
    plugins: ["faucet-pipeline-foo"]

(Of course users would have to know which configuration key is used by the respective plugin and plugins might clash, but neither seems like an actual problem.)

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

Yes, you are right. But I don't understand

    foo: ,
    plugins: ["faucet-pipeline-foo"]

Is this "convention over configuration", and we require faucet-pipeline-(\w+)?

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

I'm a little offended that you'd think I'd propose something like that...

The respective plugin would determine all of the three aforementioned aspects:

exports.key = "js";
exports.bucket = "scripts";
exports.plugin = () => ;

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

Mission accomplished ✅

Ok, understood. But then let's make it only an array, ok? More options are not a good idea I think. The rules would be:

  • core requires everything that is in the plugins array (those can be package names or relative paths – just as require expects it), expecting that it exports key, bucket and plugin. It throws an error, if that is not the case.
  • It then checks for all keys of the imported plugins as well as the default plugins (js, css, static, sass).

Right? So this would work:

  js: { ... },
  foo: { ... },
  bar: { ... },
  plugins: ["faucet-pipeline-foo", "../faucet-pipeline-bar"]

This is then only a breaking change for users of "unofficial plugins". As the only one I know of is faucet-pipeline-nunjucks which is not even published right now, I would not mark this as a breaking change.

from faucet-pipeline-core.

FND avatar FND commented on July 20, 2024

shia.gif

from faucet-pipeline-core.

moonglum avatar moonglum commented on July 20, 2024

👍
I'll do it on the train ride back on Thursday iff I'm not too tired.

from faucet-pipeline-core.

Related Issues (20)

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.