Comments (20)
I was way too tired.
from faucet-pipeline-core.
I don't understand where we get the bucket from?
from faucet-pipeline-core.
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.
I agree. But does the plugin expose its bucket type?
from faucet-pipeline-core.
I don't know what that means, exactly.
from faucet-pipeline-core.
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.
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.
Ok, makes sense. Let's do this 👍
from faucet-pipeline-core.
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.
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.
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.
Shouldn't this be a version conflict, because faucet-static expects a version < 2.0?
from faucet-pipeline-core.
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.
As discussed, we will try to make this a non-breaking change
from faucet-pipeline-core.
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.
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.
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.
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 asrequire
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
key
s 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.
shia.gif
from faucet-pipeline-core.
👍
I'll do it on the train ride back on Thursday iff I'm not too tired.
from faucet-pipeline-core.
Related Issues (20)
- Action required: Greenkeeper could not be activated 🚨 HOT 1
- Replace live-server with five-server?
- More customization for the manifest output HOT 1
- presets for common use cases
- `resolveModulePath` fails on legacy Node HOT 1
- realpath for testing HOT 5
- Source map Support HOT 3
- Version 10 of node.js has been released HOT 1
- An in-range update of browserslist is breaking the build 🚨 HOT 2
- drop Node 6 compatibility after 04/2019 HOT 1
- Config File Details HOT 1
- replace Travis CI HOT 2
- An in-range update of browserslist is breaking the build 🚨 HOT 1
- An in-range update of browserslist is breaking the build 🚨 HOT 2
- An in-range update of eslint-config-fnd is breaking the build 🚨 HOT 1
- Catch ENOSPC when watching, give hint, then crash HOT 1
- ESM compatibility HOT 1
- Missing manifest file on first run HOT 3
- `require.resolve` doesn't work for folders in `node_modules` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faucet-pipeline-core.