New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

next-server

Package Overview
Dependencies
Maintainers
26
Versions
254
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-server - npm Package Compare versions

Comparing version 8.0.0-canary.4 to 8.0.0-canary.6

12

dist/lib/router/router.js

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const url_1 = require("url");

@@ -12,2 +13,3 @@ const mitt_1 = __importDefault(require("../mitt"));

const utils_1 = require("../utils");
exports.RouterContext = react_1.default.createContext();
class Router {

@@ -157,3 +159,2 @@ constructor(pathname, query, as, { initialProps, pageLoader, App, Component, ErrorComponent, err } = {}) {

}
const { pathname: asPathname, query: asQuery } = url_1.parse(as, true);
const { pathname, query } = url_1.parse(url, true);

@@ -164,3 +165,4 @@ // If asked to change the current URL we should reload the current page

// as this should not go into the history (That's how browsers work)
if (!this.urlIsNew(asPathname, asQuery)) {
// We should compare the new asPath to the current asPath, not the url
if (!this.urlIsNew(as)) {
method = 'replaceState';

@@ -308,4 +310,6 @@ }

}
urlIsNew(pathname, query) {
return this.pathname !== pathname || !shallow_equals_1.default(query, this.query);
urlIsNew(asPath) {
const { pathname, query } = url_1.parse(asPath, true);
const { pathname: curPathname } = url_1.parse(this.asPath, true);
return curPathname !== pathname || !shallow_equals_1.default(query, this.query);
}

@@ -312,0 +316,0 @@ isShallowRoutingPossible(route) {

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

if (this.nextConfig.poweredByHeader) {
res.setHeader('X-Powered-By', 'Next.js ' + "8.0.0-canary.4");
res.setHeader('X-Powered-By', 'Next.js ' + "8.0.0-canary.6");
}

@@ -194,0 +194,0 @@ return this.sendHTML(req, res, html);

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

const server_1 = require("react-dom/server");
const router_1 = __importDefault(require("../lib/router/router"));
const router_1 = __importStar(require("../lib/router/router"));
const utils_1 = require("../lib/utils");

@@ -98,3 +98,4 @@ const head_1 = __importStar(require("../lib/head"));

return render(renderElementToString, react_1.default.createElement(loadable_capture_1.default, { report: (moduleName) => reactLoadableModules.push(moduleName) },
react_1.default.createElement(EnhancedApp, Object.assign({ Component: EnhancedComponent, router: router }, props))));
react_1.default.createElement(router_1.RouterContext.Provider, { value: router },
react_1.default.createElement(EnhancedApp, Object.assign({ Component: EnhancedComponent, router: router }, props)))));
};

@@ -101,0 +102,0 @@ const docProps = await utils_1.loadGetInitialProps(Document, Object.assign({}, ctx, { renderPage }));

{
"name": "next-server",
"version": "8.0.0-canary.4",
"version": "8.0.0-canary.6",
"main": "./index.js",

@@ -39,4 +39,4 @@ "license": "MIT",

"peerDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0"
"react": "^16.3.0",
"react-dom": "^16.3.0"
},

@@ -56,3 +56,3 @@ "devDependencies": {

},
"gitHead": "2a9b7337154ac269d60f1613381bc1344a360d84"
"gitHead": "f94d24bffc44aa20740abda54032357fca73224b"
}
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