next-server
Advanced tools
Comparing version 8.1.1-canary.62 to 8.1.1-canary.63
@@ -1,1 +0,1 @@ | ||
export * from './dist/lib/amp' | ||
export { useAmp } from './dist/lib/amp' |
@@ -1,1 +0,2 @@ | ||
module.exports = require('./dist/lib/amp') | ||
const { useAmp } = require('./dist/lib/amp') | ||
module.exports = { useAmp } |
@@ -7,7 +7,1 @@ export declare function isInAmpMode({ ampFirst, hybrid, hasQuery, }?: { | ||
export declare function useAmp(): boolean; | ||
/** | ||
* @deprecated This is no longer required, use export const config = { amp: true } | ||
*/ | ||
export declare function withAmp(Component: any, { hybrid }?: { | ||
hybrid?: boolean | undefined; | ||
}): any; |
@@ -18,16 +18,1 @@ "use strict"; | ||
exports.useAmp = useAmp; | ||
/** | ||
* @deprecated This is no longer required, use export const config = { amp: true } | ||
*/ | ||
function withAmp(Component, { hybrid = false } = {}) { | ||
function WithAmpWrapper(props = {}) { | ||
const ampState = react_1.default.useContext(amp_context_1.AmpStateContext); | ||
ampState.ampFirst = !hybrid; | ||
ampState.hybrid = hybrid; | ||
return react_1.default.createElement(Component, props); | ||
} | ||
WithAmpWrapper.__nextAmpOnly = !hybrid; | ||
WithAmpWrapper.getInitialProps = Component.getInitialProps; | ||
return WithAmpWrapper; | ||
} | ||
exports.withAmp = withAmp; |
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
import { ParsedUrlQuery } from 'querystring'; | ||
import { ManifestItem } from '../server/get-dynamic-import-bundles'; | ||
import { ManifestItem } from '../server/render'; | ||
import { BaseRouter } from './router/router'; | ||
@@ -9,0 +9,0 @@ /** |
@@ -6,5 +6,13 @@ /// <reference types="node" /> | ||
import { DocumentType, AppType, NextPageContext } from '../lib/utils'; | ||
import { Manifest as ReactLoadableManifest } from './get-dynamic-import-bundles'; | ||
import { BuildManifest } from './get-page-files'; | ||
import { IPageConfig } from './load-components'; | ||
export declare type ManifestItem = { | ||
id: number | string; | ||
name: string; | ||
file: string; | ||
publicPath: string; | ||
}; | ||
declare type ReactLoadableManifest = { | ||
[moduleId: string]: ManifestItem[]; | ||
}; | ||
declare type RenderOpts = { | ||
@@ -11,0 +19,0 @@ documentMiddlewareEnabled: boolean; |
@@ -25,3 +25,2 @@ "use strict"; | ||
const data_manager_1 = require("../lib/data-manager"); | ||
const get_dynamic_import_bundles_1 = require("./get-dynamic-import-bundles"); | ||
const get_page_files_1 = require("./get-page-files"); | ||
@@ -257,8 +256,14 @@ const amp_context_1 = require("../lib/amp-context"); | ||
} | ||
const dynamicImports = [ | ||
...get_dynamic_import_bundles_1.getDynamicImportBundles(reactLoadableManifest, reactLoadableModules), | ||
]; | ||
const dynamicImportsIds = [ | ||
...new Set(dynamicImports.map(bundle => bundle.id)), | ||
]; | ||
const dynamicImportIdsSet = new Set(); | ||
const dynamicImports = []; | ||
for (const mod of reactLoadableModules) { | ||
const manifestItem = reactLoadableManifest[mod]; | ||
if (manifestItem) { | ||
manifestItem.map(item => { | ||
dynamicImports.push(item); | ||
dynamicImportIdsSet.add(item.id); | ||
}); | ||
} | ||
} | ||
const dynamicImportsIds = [...dynamicImportIdsSet]; | ||
const inAmpMode = amp_1.isInAmpMode(ampState); | ||
@@ -265,0 +270,0 @@ const hybridAmp = ampState.hybrid; |
{ | ||
"name": "next-server", | ||
"version": "8.1.1-canary.62", | ||
"version": "8.1.1-canary.63", | ||
"main": "./index.js", | ||
@@ -73,3 +73,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "808a3bcc66b13ef4a2a59fd741550c79d77331b1" | ||
"gitHead": "aeeba6b2e8738a3ff83bd76d1aec36213529f013" | ||
} |
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
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
134106
91
3396