react-loadable-ssr-addon
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -1,7 +0,13 @@ | ||
## Description | ||
## Summary | ||
A few sentences describing the overall goals of the pull request's commits. | ||
## Why | ||
A few sentences describing the overall goals of the pull request's commits. | ||
A few sentences describing the reasons behind this pull request. | ||
## Checklist | ||
- [ ] Your code builds clean without any `errors` or `warnings` | ||
- [ ] You are using `approved terminology` | ||
- [ ] You have added `unit tests`, if apply. | ||
## Emojis for categorizing pull requests: | ||
@@ -8,0 +14,0 @@ |
@@ -6,10 +6,12 @@ "use strict"; | ||
var _unique = _interopRequireDefault(require("./utils/unique")); | ||
var _utils = require("./utils"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function getBundles(manifest, chunks) { | ||
if (!manifest || !chunks) { | ||
return {}; | ||
} | ||
function getBundles(manifest, chunks) { | ||
var assetsKey = chunks.reduce(function (key, chunk) { | ||
if (manifest.origins[chunk]) { | ||
key = (0, _unique["default"])([].concat(key, manifest.origins[chunk])); | ||
key = (0, _utils.unique)([].concat(key, manifest.origins[chunk])); | ||
} | ||
@@ -27,3 +29,3 @@ | ||
bundle[key] = (0, _unique["default"])([].concat(bundle[key], content)); | ||
bundle[key] = (0, _utils.unique)([].concat(bundle[key], content)); | ||
}); | ||
@@ -30,0 +32,0 @@ return bundle; |
"use strict"; | ||
exports.__esModule = true; | ||
exports["default"] = void 0; | ||
exports["default"] = exports.defaultOptions = void 0; | ||
@@ -29,2 +29,3 @@ var _fs = _interopRequireDefault(require("fs")); | ||
}; | ||
exports.defaultOptions = defaultOptions; | ||
@@ -104,2 +105,6 @@ var ReactLoadableSSRAddon = function () { | ||
if (this.entrypoints.has(names[0])) { | ||
origins.add(names[0]); | ||
} | ||
return Array.from(origins); | ||
@@ -167,3 +172,3 @@ }; | ||
if (!(0, _utils.isDuplicated)(assets[id][ext], 'file', file)) { | ||
if (!(0, _utils.hasEntry)(assets[id][ext], 'file', file)) { | ||
var shouldComputeIntegrity = Object.keys(currentAsset) && _this.options.integrity && !currentAsset[_this.options.integrityPropertyName]; | ||
@@ -256,2 +261,3 @@ | ||
exports["default"] = ReactLoadableSSRAddon; | ||
var _default = ReactLoadableSSRAddon; | ||
exports["default"] = _default; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.isDuplicated = exports.unique = exports.getFileExtension = exports.computeIntegrity = void 0; | ||
exports.hasEntry = exports.unique = exports.getFileExtension = exports.computeIntegrity = void 0; | ||
@@ -18,6 +18,6 @@ var _computeIntegrity = _interopRequireDefault(require("./computeIntegrity")); | ||
var _isDuplicated = _interopRequireDefault(require("./isDuplicated")); | ||
var _hasEntry = _interopRequireDefault(require("./hasEntry")); | ||
exports.isDuplicated = _isDuplicated["default"]; | ||
exports.hasEntry = _hasEntry["default"]; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
{ | ||
"name": "react-loadable-ssr-addon", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Server Side Render add-on for React Loadable. Load splitted chunks was never that easy.", | ||
@@ -31,2 +31,3 @@ "main": "lib/index.js", | ||
"lint:fix": "eslint --ext js --ext jsx source --fix|| exit 0", | ||
"test": "npm run clean:example && npm run build && webpack && ava && npm run clean:example", | ||
"stats": "NODE_ENV=development webpack --profile --json > compilation-stats.json" | ||
@@ -51,2 +52,4 @@ }, | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/register": "^7.4.0", | ||
"ava": "^1.4.1", | ||
"babel-loader": "^8.0.2", | ||
@@ -74,3 +77,12 @@ "babel-plugin-dynamic-import-node": "^2.1.0", | ||
} | ||
}, | ||
"ava": { | ||
"files": [ | ||
"source/**/*.test.js" | ||
], | ||
"require": [ | ||
"@babel/register" | ||
], | ||
"concurrency": 5 | ||
} | ||
} |
@@ -344,2 +344,4 @@ # React Loadable SSR Add-on | ||
## Release History | ||
* 0.1.9 | ||
* FIX: [Missing entry in origins](https://github.com/themgoncalves/react-loadable-ssr-addon/pull/13) reported by [@p-j](https://github.com/p-j); | ||
* 0.1.8 | ||
@@ -355,2 +357,6 @@ * Includes all features from deprecated v0.1.7; | ||
* FIX: [Issue #7](https://github.com/themgoncalves/react-loadable-ssr-addon/issues/7) reported by [@themgoncalves](https://github.com/themgoncalves) and [@tomkelsey](https://github.com/tomkelsey) | ||
<details> | ||
<summary>See older release note</summary> | ||
* 0.1.4 | ||
@@ -370,2 +376,3 @@ * FIX: [Issue #5](https://github.com/themgoncalves/react-loadable-ssr-addon/issues/5) reported by [@tomkelsey](https://github.com/tomkelsey) | ||
* Work in progress | ||
</details> | ||
@@ -392,2 +399,18 @@ <br /> | ||
### Emojis for categorizing commits: | ||
⚡️ New feature (`:zap:`) | ||
🐛 Bug fix (`:bug:`) | ||
🔥 P0 fix (`:fire:`) | ||
✅ Tests (`:white_check_mark:`) | ||
🚀 Performance improvements (`:rocket:`) | ||
🖍 CSS / Styling (`:crayon:`) | ||
♿ Accessibility (`:wheelchair:`) | ||
🌐 Internationalization (`:globe_with_meridians:`) | ||
📖 Documentation (`:book:`) | ||
🏗 Infrastructure / Tooling / Builds / CI (`:building_construction:`) | ||
⏪ Reverting a previous change (`:rewind:`) | ||
♻️ Refactoring (like moving around code w/o any changes) (`:recycle:`) | ||
🚮 Deleting code (`:put_litter_in_its_place:`) | ||
<!-- Markdown link & img dfn's --> | ||
@@ -394,0 +417,0 @@ |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
import unique from './utils/unique'; | ||
import { unique } from './utils'; | ||
@@ -17,2 +17,4 @@ /** | ||
function getBundles(manifest, chunks) { | ||
if (!manifest || !chunks) { return {}; } | ||
const assetsKey = chunks.reduce((key, chunk) => { | ||
@@ -19,0 +21,0 @@ if (manifest.origins[chunk]) { |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
@@ -6,0 +6,0 @@ |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
@@ -10,3 +10,3 @@ | ||
import url from 'url'; | ||
import { getFileExtension, computeIntegrity, isDuplicated } from './utils'; | ||
import { getFileExtension, computeIntegrity, hasEntry } from './utils'; | ||
@@ -29,3 +29,3 @@ // Webpack plugin name | ||
*/ | ||
export default class ReactLoadableSSRAddon { | ||
class ReactLoadableSSRAddon { | ||
/** | ||
@@ -148,2 +148,5 @@ * @constructs ReactLoadableSSRAddon | ||
if (origins.size === 0) { return [names[0] || id]; } | ||
if (this.entrypoints.has(names[0])) { | ||
origins.add(names[0]); | ||
} | ||
@@ -229,3 +232,3 @@ return Array.from(origins); | ||
if (!isDuplicated(assets[id][ext], 'file', file)) { | ||
if (!hasEntry(assets[id][ext], 'file', file)) { | ||
const shouldComputeIntegrity = Object.keys(currentAsset) | ||
@@ -281,1 +284,4 @@ && this.options.integrity | ||
} | ||
export { defaultOptions }; | ||
export default ReactLoadableSSRAddon; |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
@@ -6,0 +6,0 @@ |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
@@ -6,0 +6,0 @@ |
export { default as computeIntegrity } from './computeIntegrity'; | ||
export { default as getFileExtension } from './getFileExtension'; | ||
export { default as unique } from './unique'; | ||
export { default as isDuplicated } from './isDuplicated'; | ||
export { default as hasEntry } from './hasEntry'; |
/** | ||
* react-loadable-ssr-addon | ||
* @author Marcos Gonçalves <contact@themgoncalves.com> | ||
*@version 0.1.8 | ||
* @version 0.1.9 | ||
*/ | ||
@@ -6,0 +6,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268089
46
1256
430
27
8