profile
viewpoint
遗忘
Swashata Ghosh swashata @WPQuark Gurugram, India https://swas.io Part time open sources. Love React, WordPress, Nodejs, VSCode, Sublime text.

micc83/fontIconPicker 264

jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.

swashata/ipt-knowledgebase-theme-wp 95

WP Knowledge Base WordPress Theme - by iPanelThemes.com

swashata/IcoMoonIconIndexer 9

Index and categorize Icons generated from IcoMoon

lubusIN/composer-edd-plugin 5

Composer plugin for installing pro plugins powered by EDD software licensing

jamup-dev/react-with-firestore 1

A simple notes application built with React and FireStore

swashata/ama6oct2018 1

AMA on 6th october 2018

swashata/awesome-bash-prompt 1

A bash prompt with FontAwesome and oh-my-git. Icons used from nerd-fonts for windows compatibility. Lovingly forked from https://github.com/arialdomartini/oh-my-git

swashata/Easy-Bootstrap-Shortcode 1

Wordpress Easy Bootstrap Shortcode Plugin is bootstrap 3.0 compatible plugin which add icons to wordpress editor (tinyMCE Shortcode Buttons) and one can add bootstrap style to their website just by clicking on tinyMCE editor icon.

swashata/ipt-colorized 1

WP Colorized Theme by iPanelThemes.com

jamup-dev/graphql-101 0

Basics of GraphQL

startedadobe/react-spectrum

started time in an hour

startedwslutilities/wslu

started time in 2 days

startedgruntwork-io/cloud-nuke

started time in 7 days

push eventswashata/swas.io

Swashata Ghosh

commit sha eb955a8a79395e5792a367341d049e0e9f342210

fix: remove duplicate stuff

view details

push time in 8 days

startedbvaughn/react-highlight-words

started time in 8 days

startedepoberezkin/fast-deep-equal

started time in 16 days

startedfoambubble/foam

started time in 18 days

startedschenkd/nginx-ui

started time in 23 days

issue closedswashata/wpackio-enqueue

Get url of an arbitrary image not included in stylesheet/javascript

I have found this issue related to getting a image URL from the manifest: https://github.com/swashata/wpackio-enqueue/issues/4

However, this does not work since my image is only used in the HTML (for an Admin Menu Icon), so it is not included in the manifest. Is there a way to force it to be included in the manifest?

closed time in 25 days

simplenotezy

created tagswashata/wpackio-enqueue

tag2.2.0

WordPress & PHP API for @wpackio/scripts

created time in 25 days

release swashata/wpackio-enqueue

2.2.0

released time in 25 days

push eventswashata/wpackio-enqueue

Swashata Ghosh

commit sha 596fb1d6af97b96906058237165f3fe161ffa685

chore: prepare version 2.2.0

view details

push time in 25 days

push eventswashata/wpackio-enqueue

Swashata Ghosh

commit sha 39801fb5e00a44bd2a9435fa5bc73d9076f08a24

fix: issue with static variable breaking multiple instances Fixes #10

view details

Swashata Ghosh

commit sha 907ca70a8c7bc98e2b583530c967bbcd4c7c071f

chore: upgrade composer deps & use pcov Also let travis know of the stuff.

view details

push time in 25 days

issue closedswashata/wpackio-enqueue

Interaction wpackio\enqueue if you have 2 instances .. e.g two plugin using wpackio

Hi there, I got troubled by this issue and I think I found a reason ... at least it works now. manifestCache was static ... is there any idea behind that why it is static?

As then it use manifest from different instance .. depend what runs first

Have a great day:)

closed time in 25 days

deeppresentation

issue commentswashata/wpackio-enqueue

Interaction wpackio\enqueue if you have 2 instances .. e.g two plugin using wpackio

On another thought, I don't see why the variable was static at the first place. We can have an instance variable instead of the static one and the issue should go away.

deeppresentation

comment created time in 25 days

startedduiker101/twitter-interaction-circles

started time in 25 days

issue commentfacebook/jest

Jest --coverage - Nothing was returned from render

Hi @rbong,

You are absolutely correct. Per the babel issue, once I upgraded underlying dependencies, especially @babel/generator to 7.10.2, the issue went away. So this is not really an issue of jest or istanbul, rather of babel, which has already been fixed recently.

gunaerode

comment created time in a month

issue commentswashata/wpackio-enqueue

Interaction wpackio\enqueue if you have 2 instances .. e.g two plugin using wpackio

Hi,

You are correct. Right now we have

		if ( ! isset( self::$manifestCache[ $this->outputPath ] ) ) {
			self::$manifestCache[ $this->outputPath ] = [];
		}
		self::$manifestCache[ $this->outputPath ][ $dir ] = $manifest;
		return self::$manifestCache[ $this->outputPath ][ $dir ];

To make it work with multiple instances, we need to include $this->appName, which should be different for different instances anyway. Something like

		if ( ! isset( self::$manifestCache[ $this->appName ] ) ) {
			self::$manifestCache[ $this->appName ] = [];
		}
		if ( ! isset( self::$manifestCache[ $this->appName ][ $this->outputPath ] ) ) {
			self::$manifestCache[ $this->appName ][ $this->outputPath ] = [];
		}
		self::$manifestCache[ $this->appName ][ $this->outputPath ][ $dir ] = $manifest;
		return self::$manifestCache[ $this->appName ][ $this->outputPath ][ $dir ];

Would you be interested in doing a PR?

deeppresentation

comment created time in a month

startedbmcmahen/sancho

started time in a month

startedbmcmahen/react-gesture-responder

started time in a month

startedpubkey/rxdb

started time in a month

startedstyled-components/polished

started time in a month

startedcallstack/linaria

started time in a month

startedtummychow/git-absorb

started time in a month

issue commentfacebook/jest

Jest --coverage - Nothing was returned from render

I did some further digging and found, when code-coverage is not running, babel transforms the component just fine

    function AppWrap(props) {
      const children = props.children;
      const ref = (0, _react.useRef)(null);
      const size = (0, _componentSize.default)(ref);
      return /*#__PURE__*/_react.default.createElement(_styled.ThemeWrapper, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 32,
          columnNumber: 3
        }
      }, /*#__PURE__*/_react.default.createElement(AppWrapDiv, {
        className: "wpeform-admin-app",
        id: "wpeform-admin-app",
        ref: ref,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 33,
          columnNumber: 4
        }
      }, /*#__PURE__*/_react.default.createElement(GlobalStyle, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 38,
          columnNumber: 5
        }
      }), /*#__PURE__*/_react.default.createElement(_contexts.AdminAppWrapContext.Provider, {
        value: size,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 39,
          columnNumber: 5
        }
      }, children)));
    }
gunaerode

comment created time in a month

issue commentfacebook/jest

Jest --coverage - Nothing was returned from render

Hi,

Upon further investigation, I have found that it is indeed istanbul issue. For the source code which looks like

export default function AppWrap(props: AppWrapProps) {
	const { children } = props;
	const ref = useRef(null);
	const size = useComponentSize(ref);
	return (
		<ThemeWrapper>
			<AppWrapDiv
				className="wpeform-admin-app"
				id="wpeform-admin-app"
				ref={ref}
			>
				<GlobalStyle />
				<AdminAppWrapContext.Provider value={size}>
					{children}
				</AdminAppWrapContext.Provider>
			</AppWrapDiv>
		</ThemeWrapper>
	);
}

It gets transformed into

    function AppWrap(props) {
      /* istanbul ignore next */
      cov_2eptln9psz().f[1]++;

      const _ref = (cov_2eptln9psz().s[3]++, props),
            children = _ref.children;

      const ref =
      /* istanbul ignore next */
      (cov_2eptln9psz().s[4]++,
      /* istanbul ignore next */
      (0,
      /* istanbul ignore next */
      _react.
      /* istanbul ignore next */
      useRef)(null));
      const size =
      /* istanbul ignore next */
      (cov_2eptln9psz().s[5]++,
      /* istanbul ignore next */
      (0,
      /* istanbul ignore next */
      _componentSize.
      /* istanbul ignore next */
      default)(ref));

      /* istanbul ignore next */
      cov_2eptln9psz().s[6]++;
      return /*#__PURE__*/
      /* istanbul ignore next */
      _react.default.createElement(
      /* istanbul ignore next */
      _styled.
      /* istanbul ignore next */
      ThemeWrapper,
      /* istanbul ignore next */
      {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 32,
          columnNumber: 3
        }
      }, /*#__PURE__*/
      /* istanbul ignore next */
      _react.default.createElement(AppWrapDiv,
      /* istanbul ignore next */
      {
        className: "wpeform-admin-app",
        id: "wpeform-admin-app",
        ref: ref,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 33,
          columnNumber: 4
        }
      }, /*#__PURE__*/
      /* istanbul ignore next */
      _react.default.createElement(GlobalStyle,
      /* istanbul ignore next */
      {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 38,
          columnNumber: 5
        }
      }), /*#__PURE__*/
      /* istanbul ignore next */
      _react.default.createElement(
      /* istanbul ignore next */

      /* istanbul ignore next */
      _contexts.
      /* istanbul ignore next */
      AdminAppWrapContext.Provider,
      /* istanbul ignore next */
      {
        value: size,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 39,
          columnNumber: 5
        }
      }, children)));
    }

Notice there is no parenthesis near

   return /*#__PURE__*/
      /* istanbul ignore next */

Any pointers on how further I can debug this?

gunaerode

comment created time in a month

issue commentfacebook/jest

Jest --coverage - Nothing was returned from render

Hi,

While right now, I cannot give a reproducible minimal repo, I CAN say that it happens in JEST and not CRA. I am using in my project with custom webpack (no CRA installation at all) and finding this issue.

@jeysal and @SimenB I think the issue is with istanbul. When doing coverage, does the latest version of Jest pass the code as-is to istanbul first and then babel-jest? If so, it might explain @flipb1ts solution. I do remember istanbul adding some code to every expression and statement to count coverage. If multi-line JSX breaks the coverage, this might be the cause.

gunaerode

comment created time in a month

starteddebauchee/barrier

started time in a month

startediCHAIT/awesome-macOS

started time in a month

startedreact-hook-form/react-hook-form

started time in a month

issue commentbmewburn/vscode-intelephense

Add support class_alias function

Yes please. I can mention one very important use case for WordPress test libraries. There we have something like

if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) {

	class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' );
	class_alias( 'PHPUnit\Framework\Exception', 'PHPUnit_Framework_Exception' );
	class_alias( 'PHPUnit\Framework\ExpectationFailedException', 'PHPUnit_Framework_ExpectationFailedException' );
	class_alias( 'PHPUnit\Framework\Error\Deprecated', 'PHPUnit_Framework_Error_Deprecated' );
	class_alias( 'PHPUnit\Framework\Error\Notice', 'PHPUnit_Framework_Error_Notice' );
	class_alias( 'PHPUnit\Framework\Error\Warning', 'PHPUnit_Framework_Error_Warning' );
	class_alias( 'PHPUnit\Framework\Test', 'PHPUnit_Framework_Test' );
	class_alias( 'PHPUnit\Framework\Warning', 'PHPUnit_Framework_Warning' );
	class_alias( 'PHPUnit\Framework\AssertionFailedError', 'PHPUnit_Framework_AssertionFailedError' );
	class_alias( 'PHPUnit\Framework\TestSuite', 'PHPUnit_Framework_TestSuite' );
	class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' );
	class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' );
	class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );

	class PHPUnit_Util_Test {

		// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
		public static function getTickets( $class_name, $method_name ) {
			$annotations = PHPUnit\Util\Test::parseTestMethodAnnotations( $class_name, $method_name );

			$tickets = array();

			if ( isset( $annotations['class']['ticket'] ) ) {
				$tickets = $annotations['class']['ticket'];
			}

			if ( isset( $annotations['method']['ticket'] ) ) {
				$tickets = array_merge( $tickets, $annotations['method']['ticket'] );
			}

			return array_unique( $tickets );
		}

	}

}

Without getting over the debate of why WordPress is doing this, I think we can all benefit from intelephese if this feature is implemented.

Sumanai

comment created time in a month

issue commentTypeStrong/fork-ts-checker-webpack-plugin

Difficulty with webpack multi-compiler and plugin hooks

Hi @piotr-oles I will take a look once I get a chance.

swashata

comment created time in a month

startedtannerlinsley/react-query

started time in a month

startedjaredpalmer/codemods

started time in a month

startedmadisvain/upcount

started time in a month

startedtholman/cursor-effects

started time in a month

startedVulcanJS/Vulcan

started time in 2 months

startedpshihn/rough-notation

started time in 2 months

startedcrossterm-rs/crossterm

started time in 2 months

startedsgwilym/windups

started time in 2 months

startedSimonwep/nanopop

started time in 2 months

startedmswjs/msw

started time in 2 months

create barnchswashata/dotfile

branch : master

created branch time in 2 months

created repositoryswashata/dotfile

My Dot Files

created time in 2 months

issue commentianstormtaylor/slate

Undo of inserting nodes fails, leads to console error

Hello,

This is happening for me too. I will try to create a reproducible repo.

oyeanuj

comment created time in 2 months

startedaccordproject/markdown-editor

started time in 2 months

startedsproutcore/sproutcore

started time in 2 months

startednikersify/pico

started time in 2 months

starteddiegomura/react-pdf

started time in 2 months

startedjaredpalmer/tsdx

started time in 2 months

startedtylerzey/better-video-embeds

started time in 2 months

starteddandavison/delta

started time in 2 months

startedmholt/PapaParse

started time in 2 months

issue commentswashata/wp-webpack-script

Dist folder is empty when running start script

Hello,

Please try this

module.exports = {
	proxy: 'http://localhost/<wp-folder>/',
	distPublicPath: '/wp-content/themes/<my-theme>/dist/',
};

Also kindly report back to me whether this works or not.

primozw

comment created time in 3 months

startedstyfle/awesome-desktop-js

started time in 3 months

more