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

react-loadable-ssr-addon

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-loadable-ssr-addon - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

1

AUTHORS.md

@@ -9,3 +9,4 @@ react-loadable-ssr-addon is authored by:

* Phuong Nguyen <nguyenngocphuongnb@gmail.com>
* Sébastien Lorber <slorber@users.noreply.github.com>
* dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* endiliey <endiliey@gmail.com>

2

lib/getBundles.js

@@ -21,3 +21,3 @@ "use strict";

return assetsKey.reduce(function (bundle, asset) {
Object.keys(manifest.assets[asset]).forEach(function (key) {
Object.keys(manifest.assets[asset] || {}).forEach(function (key) {
var content = manifest.assets[asset][key];

@@ -24,0 +24,0 @@

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _ava = _interopRequireDefault(require("ava"));

@@ -13,4 +15,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var modules = ['./Header', './multilevel/Multilevel', './SharedMultilevel', '../../SharedMultilevel'];

@@ -17,0 +17,0 @@ var fileType = ['js'];

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _ReactLoadableSSRAddon = _interopRequireDefault(require("./ReactLoadableSSRAddon"));

@@ -7,5 +9,3 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
module.exports = _ReactLoadableSSRAddon["default"];
module.exports.getBundles = _getBundles["default"];
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = exports.defaultOptions = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _fs = _interopRequireDefault(require("fs"));

@@ -14,10 +20,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var PLUGIN_NAME = 'ReactLoadableSSRAddon';

@@ -38,3 +36,3 @@ var defaultOptions = {

this.options = _extends({}, defaultOptions, options);
this.options = (0, _extends2["default"])({}, defaultOptions, options);
this.compiler = null;

@@ -259,3 +257,3 @@ this.stats = null;

_createClass(ReactLoadableSSRAddon, [{
(0, _createClass2["default"])(ReactLoadableSSRAddon, [{
key: "isRequestFromDevServer",

@@ -301,3 +299,2 @@ get: function get() {

}]);
return ReactLoadableSSRAddon;

@@ -304,0 +301,0 @@ }();

"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _ava = _interopRequireDefault(require("ava"));

@@ -9,2 +17,4 @@

var _waitForExpect = _interopRequireDefault(require("wait-for-expect"));
var _webpack = _interopRequireDefault(require("webpack"));

@@ -16,8 +26,2 @@

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var outputPath;

@@ -71,12 +75,26 @@ var manifestOutputPath;

})];
runWebpack(_webpack2["default"], t.end, function () {
var manifest = require("" + manifestOutputPath);
runWebpack(_webpack2["default"], t.end, (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee() {
var manifest;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
manifest = require("" + manifestOutputPath);
_context.next = 3;
return (0, _waitForExpect["default"])(function () {
Object.keys(manifest.assets).forEach(function (asset) {
manifest.assets[asset].js.forEach(function (_ref2) {
var integrity = _ref2.integrity;
t.truthy(integrity);
});
});
});
Object.keys(manifest.assets).forEach(function (asset) {
manifest.assets[asset].js.forEach(function (_ref) {
var integrity = _ref.integrity;
t["false"](!integrity);
});
});
});
case 3:
case "end":
return _context.stop();
}
}
}, _callee);
})));
});
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;

@@ -8,4 +10,2 @@ exports["default"] = void 0;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function computeIntegrity(algorithms, source) {

@@ -12,0 +12,0 @@ return Array.isArray(algorithms) ? algorithms.map(function (algorithm) {

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _ava = _interopRequireDefault(require("ava"));

@@ -7,4 +9,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
(0, _ava["default"])('returns the correct file extension', function (t) {

@@ -11,0 +11,0 @@ var extensions = ['.jpeg', '.js', '.css', '.json', '.xml'];

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _ava = _interopRequireDefault(require("ava"));

@@ -7,4 +9,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var assets = [{

@@ -11,0 +11,0 @@ file: 'content.chunk.js',

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;

@@ -20,4 +22,2 @@ exports.hasEntry = exports.unique = exports.getFileExtension = exports.computeIntegrity = void 0;

exports.hasEntry = _hasEntry["default"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports.hasEntry = _hasEntry["default"];
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _ava = _interopRequireDefault(require("ava"));

@@ -7,4 +9,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
(0, _ava["default"])('it filters duplicated entries', function (t) {

@@ -11,0 +11,0 @@ var duplicated = ['two', 'four'];

{
"name": "react-loadable-ssr-addon",
"version": "0.2.2",
"version": "0.2.3",
"description": "Server Side Render add-on for React Loadable. Load splitted chunks was never that easy.",

@@ -58,2 +58,3 @@ "main": "lib/index.js",

"@babel/plugin-transform-object-assign": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.1",

@@ -78,2 +79,3 @@ "@babel/preset-react": "^7.10.1",

"react-loadable": "^5.5.0",
"wait-for-expect": "^3.0.2",
"webpack": "3.6.0"

@@ -80,0 +82,0 @@ },

@@ -340,4 +340,6 @@ # React Loadable SSR Add-on

## Release History
* 0.2.3
* FIX: [Parsing `null` or `undefined` to object on `getBundles()`](https://github.com/themgoncalves/react-loadable-ssr-addon/pull/21) reported by [@slorber](https://github.com/slorber)
* 0.2.2
* FIX: As precaution measure, downgrade few dependencies due to node SemVer incompabitility.
* FIX: As precaution measure, downgrade few dependencies due to node SemVer incompatibility.
* 0.2.1

@@ -344,0 +346,0 @@ * FIX: [Possible missing chunk](https://github.com/themgoncalves/react-loadable-ssr-addon/pull/20) reported by [@lex111](https://github.com/lex111)

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -27,3 +27,3 @@

return assetsKey.reduce((bundle, asset) => {
Object.keys(manifest.assets[asset]).forEach((key) => {
Object.keys(manifest.assets[asset] || {}).forEach((key) => {
const content = manifest.assets[asset][key];

@@ -30,0 +30,0 @@ if (!bundle[key]) { bundle[key] = []; }

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

import test from 'ava';
import path from 'path';
import fs from 'fs';
import waitForExpect from 'wait-for-expect';
import webpack from 'webpack';

@@ -68,8 +69,10 @@ import config from '../webpack.config';

runWebpack(config, t.end, () => {
runWebpack(config, t.end, async () => {
const manifest = require(`${manifestOutputPath}`);
Object.keys(manifest.assets).forEach((asset) => {
manifest.assets[asset].js.forEach(({ integrity }) => {
t.false(!integrity);
await waitForExpect(() => {
Object.keys(manifest.assets).forEach((asset) => {
manifest.assets[asset].js.forEach(({ integrity }) => {
t.truthy(integrity);
});
});

@@ -76,0 +79,0 @@ });

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

/**
* react-loadable-ssr-addon
* @author Marcos Gonçalves <contact@themgoncalves.com>
* @version 0.2.2
* @version 0.2.3
*/

@@ -6,0 +6,0 @@

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