Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/react-async

Package Overview
Dependencies
Maintainers
19
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-async - npm Package Compare versions

Comparing version 5.0.0-wp5-beta.1 to 5.0.0

9

build/cjs/EventListener.js

@@ -5,3 +5,2 @@ 'use strict';

var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');

@@ -13,3 +12,2 @@

const _excluded = ["passive"];
// see https://github.com/oliviertassinari/react-event-listener/

@@ -21,5 +19,6 @@ class EventListener extends React__default["default"].PureComponent {

componentDidUpdate(_ref) {
let detachProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
componentDidUpdate({
passive,
...detachProps
}) {
this.detachListener(detachProps);

@@ -26,0 +25,0 @@ this.attachListener();

@@ -5,3 +5,2 @@ 'use strict';

var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');

@@ -32,3 +31,3 @@ var reactEffect = require('@shopify/react-effect');

const mounted = reactHooks.useMountedRef();
const load = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator(function* () {
const load = React.useCallback(async () => {
if (value != null) {

@@ -39,3 +38,3 @@ return value;

try {
const resolved = yield resolver.resolve();
const resolved = await resolver.resolve();

@@ -60,3 +59,3 @@ if (mounted.current) {

}
}), [mounted, resolver, value]);
}, [mounted, resolver, value]);
const {

@@ -63,0 +62,0 @@ id

@@ -5,3 +5,2 @@ 'use strict';

var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');

@@ -15,19 +14,12 @@ var server = require('@shopify/react-effect/server');

function getUsedAssets(_x) {
return _getUsedAssets.apply(this, arguments);
}
function _getUsedAssets() {
_getUsedAssets = _rollupPluginBabelHelpers.asyncToGenerator(function* (element, ...args) {
const asyncAssets = new assets.AsyncAssetManager();
yield server.extract(element, {
decorate: element => /*#__PURE__*/React__default["default"].createElement(assets.AsyncAssetContext.Provider, {
value: asyncAssets
}, element)
});
return asyncAssets.used(...args);
async function getUsedAssets(element, ...args) {
const asyncAssets = new assets.AsyncAssetManager();
await server.extract(element, {
decorate: element => /*#__PURE__*/React__default["default"].createElement(assets.AsyncAssetContext.Provider, {
value: asyncAssets
}, element)
});
return _getUsedAssets.apply(this, arguments);
return asyncAssets.used(...args);
}
exports.getUsedAssets = getUsedAssets;
/// <reference types="react" />
import { Omit } from '@shopify/useful-types';
import { PrefetchManager } from './context/prefetch';

@@ -4,0 +3,0 @@ interface Props {

import React from 'react';
import { Omit } from '@shopify/useful-types';
import { PrefetchManager } from './context/prefetch';

@@ -4,0 +3,0 @@ interface Props {

import { ReactElement } from 'react';
import { Arguments } from '@shopify/useful-types';
import { AsyncAssetManager } from './context/assets';
export declare function getUsedAssets(element: ReactElement<unknown>, ...args: Arguments<AsyncAssetManager['used']>): Promise<import("./context/assets").AssetSelector[]>;
export declare function getUsedAssets(element: ReactElement<unknown>, ...args: Parameters<AsyncAssetManager['used']>): Promise<import("./context/assets").AssetSelector[]>;
//# sourceMappingURL=testing.d.ts.map

@@ -1,4 +0,1 @@

function interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
module.exports = interopRequireDefault(require("./build/cjs/index.js"));
module.exports = require("./build/cjs/index.js");
{
"name": "@shopify/react-async",
"version": "5.0.0-wp5-beta.1",
"version": "5.0.0",
"license": "MIT",

@@ -31,12 +31,12 @@ "description": "Tools for creating powerful, asynchronously-loaded React components",

"engines": {
"node": ">=12.14.0"
"node": "^14.17.0 || >=16.0.0"
},
"dependencies": {
"@shopify/async": "^4.0.0-wp5-beta.1",
"@shopify/react-effect": "^4.1.7",
"@shopify/react-hooks": "^2.1.8",
"@shopify/react-hydrate": "^2.1.9",
"@shopify/react-idle": "^3.0.0-wp5-beta.1",
"@shopify/react-intersection-observer": "^3.1.7",
"@shopify/useful-types": "^3.0.5"
"@shopify/async": "^4.0.0",
"@shopify/react-effect": "^5.0.0",
"@shopify/react-hooks": "^3.0.0",
"@shopify/react-hydrate": "^3.0.0",
"@shopify/react-idle": "^3.0.0",
"@shopify/react-intersection-observer": "^4.0.0",
"@shopify/useful-types": "^5.0.0"
},

@@ -60,15 +60,14 @@ "peerDependencies": {

"exports": {
"./": "./",
"./testing": {
"esnext": "./testing.esnext",
"import": "./testing.mjs",
"require": "./testing.js"
},
".": {
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js",
"esnext": "./index.esnext"
},
"./testing": {
"import": "./testing.mjs",
"require": "./testing.js",
"esnext": "./testing.esnext"
"require": "./index.js"
}
},
"gitHead": "3d18c950fedaa4f622f4177887b3ea297eb7d0d3"
"gitHead": "ef9afc562672dcda9d7800753dc6b777ecd2d751"
}

@@ -1,4 +0,1 @@

function interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
module.exports = interopRequireDefault(require("./build/cjs/testing.js"));
module.exports = require("./build/cjs/testing.js");

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc