@shopify/react-async
Advanced tools
Comparing version 5.0.0-wp5-beta.1 to 5.0.0
@@ -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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
110920
64
1788
+ Added@shopify/react-effect@5.2.0(transitive)
+ Added@shopify/react-hooks@3.2.04.1.2(transitive)
+ Added@shopify/react-hydrate@3.1.4(transitive)
+ Added@shopify/react-intersection-observer@4.1.0(transitive)
+ Added@shopify/useful-types@5.3.0(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedscheduler@0.23.2(transitive)
- Removed@shopify/react-effect@4.1.12(transitive)
- Removed@shopify/react-hooks@2.1.19(transitive)
- Removed@shopify/react-hydrate@2.1.21(transitive)
- Removed@shopify/react-intersection-observer@3.1.11(transitive)
- Removed@shopify/useful-types@3.1.0(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedscheduler@0.20.2(transitive)
Updated@shopify/async@^4.0.0
Updated@shopify/react-effect@^5.0.0
Updated@shopify/react-hooks@^3.0.0
Updated@shopify/react-idle@^3.0.0
Updated@shopify/useful-types@^5.0.0