GithubHelp home page GithubHelp logo

Comments (8)

IbrahemElanany avatar IbrahemElanany commented on July 24, 2024 2

gutil.File => https://www.npmjs.com/package/vinyl
gutil.replaceExtension => The .extname property on Vinyl objects or https://www.npmjs.com/package/replace-ext
gutil.colors => https://www.npmjs.com/package/ansi-colors
gutil.date => https://www.npmjs.com/package/date-format
gutil.log => https://www.npmjs.com/package/fancy-log
gutil.template => https://www.npmjs.com/package/lodash.template
gutil.env => https://www.npmjs.com/package/minimist
gutil.beep => https://www.npmjs.com/package/beeper
gutil.noop => https://www.npmjs.com/package/through2
gutil.isStream => Use the .isStream() method on Vinyl objects
gutil.isBuffer => Use the .isBuffer() method on Vinyl objects
gutil.isNull => Use the .isNull() method on Vinyl objects
gutil.linefeed => Use the string '\n' in your code
gutil.combine => https://www.npmjs.com/package/multipipe
gutil.buffer => https://www.npmjs.com/package/list-stream
gutil.PluginError => https://www.npmjs.com/package/plugin-error

from gulp-util.

demurgos avatar demurgos commented on July 24, 2024 1

@Spongman
noop is equivalent to () => through2.obj(). I agree it could be clearer. If you don't use the return value, an empty function should be enough. Calling noop returns a pass-through stream in object mode.

I'll take some time during the week-end to compile a list of examples of common cases I encountered while helping other modules to migrate.

from gulp-util.

CodeMan99 avatar CodeMan99 commented on July 24, 2024

How about suggesting gulp-noop (github)?

Personally I'd prefer that a PassThrough stream was used directly, but I suppose it is implementation details.

from gulp-util.

CodeMan99 avatar CodeMan99 commented on July 24, 2024

I am a bit confused by the suggestion to replace gutil.buffer with list-stream. Seems like the more well known bl or concat-stream would be more applicable.

Edit: Oh, I guess bl does not support objectMode, making it a non-starter.

from gulp-util.

katekourbatova avatar katekourbatova commented on July 24, 2024

Adding to this - there is no suggested replacement for gulp-decompress

I encountered it using Gatsby:

from gulp-util.

CodeMan99 avatar CodeMan99 commented on July 24, 2024

@katekourbatova You are reading this issue incorrectly. This is about improving suggestions for changing plugins using gulp-util. The case you are displaying is that gulp-decompress needs to follow this advice.

Tools should not be replacing whole plugins because they in turn depend on gulp-util. The proper thing to do is have gulp-decompress replace their usage of gulp-util (which is already done kevva/gulp-decompress@d3fdff1).

So for this case specifically, someone in the dependency chain needs to upgrade a version so that a newer version of gulp-decompress is used.

from gulp-util.

CodeMan99 avatar CodeMan99 commented on July 24, 2024

@katekourbatova In fact, it looks like gatsby-plugin-sharp@next solves your issue (though for some reason npm install is still showing the gulp-util deprecation notice, not sure why).

from gulp-util.

craigphicks avatar craigphicks commented on July 24, 2024

As a recent newcomer I found it frustrating to get a pointer to "though2" for noop.
I managed to make a couple of noops (a comment above helped) but not a friendly entry.

import through2 from 'through2'
import transfob from 'transfob';

async function noop2() {
	return () => through2.obj()
}
async function noop1() {
	transfob( function( file, enc, next ) {
			next( null, file );
	})
}

from gulp-util.

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.