Socket
Socket
Sign inDemoInstall

next

Package Overview
Dependencies
Maintainers
3
Versions
2734
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next - npm Package Compare versions

Comparing version 2.0.0-beta.23 to 2.0.0-beta.24

38

dist/lib/router/router.js

@@ -112,3 +112,3 @@ 'use strict';

var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(e) {
var _e$state, url, as, _parse, pathname, query, route, _ref3, data, props, error;
var _pathname, _query, _e$state, url, as, _parse, pathname, query, route, _ref3, data, props, error;

@@ -120,9 +120,21 @@ return _regenerator2.default.wrap(function _callee$(_context) {

if (e.state) {
_context.next = 2;
_context.next = 4;
break;
}
// We get state as undefined for two reasons.
// 1. With older safari (< 8) and older chrome (< 34)
// 2. When the URL changed with #
//
// In the both cases, we don't need to proceed and change the route.
// (as it's already changed)
// But we can simply replace the state with the new changes.
// Actually, for (1) we don't need to nothing. But it's hard to detect that event.
// So, doing the following for (1) does no harm.
_pathname = this.pathname, _query = this.query;
this.replace((0, _url.format)({ pathname: _pathname, query: _query }), getURL());
return _context.abrupt('return');
case 2:
case 4:

@@ -135,3 +147,3 @@ this.abortComponentLoad();

if (this.urlIsNew(pathname, query)) {
_context.next = 9;
_context.next = 11;
break;

@@ -144,3 +156,3 @@ }

case 9:
case 11:
route = toRoute(pathname);

@@ -150,6 +162,6 @@

this.emit('routeChangeStart', as);
_context.next = 13;
_context.next = 15;
return this.getRouteInfo(route, pathname, query);
case 13:
case 15:
_ref3 = _context.sent;

@@ -161,3 +173,3 @@ data = _ref3.data;

if (!(error && error.cancelled)) {
_context.next = 20;
_context.next = 22;
break;

@@ -169,3 +181,3 @@ }

case 20:
case 22:

@@ -181,3 +193,3 @@ this.route = route;

case 23:
case 25:
case 'end':

@@ -622,3 +634,7 @@ return _context.stop();

function getURL() {
return window.location.pathname + (window.location.search || '') + (window.location.hash || '');
var _window$location = window.location,
href = _window$location.href,
origin = _window$location.origin;
return href.substring(origin.length);
}

@@ -625,0 +641,0 @@

{
"name": "next",
"version": "2.0.0-beta.23",
"version": "2.0.0-beta.24",
"description": "Minimalistic framework for server-rendered React applications",

@@ -49,3 +49,3 @@ "main": "./dist/server/next.js",

"babel-loader": "6.2.10",
"babel-plugin-module-resolver": "2.4.0",
"babel-plugin-module-resolver": "2.5.0",
"babel-plugin-react-require": "^3.0.0",

@@ -82,3 +82,3 @@ "babel-plugin-transform-async-to-generator": "6.22.0",

"strip-ansi": "3.0.1",
"styled-jsx": "0.5.3",
"styled-jsx": "0.5.4",
"url": "0.11.0",

@@ -100,3 +100,3 @@ "uuid": "3.0.1",

"chromedriver": "^2.26.1",
"coveralls": "2.11.15",
"coveralls": "2.11.16",
"gulp": "3.9.1",

@@ -103,0 +103,0 @@ "gulp-babel": "6.1.2",

@@ -677,2 +677,6 @@ <img width="112" alt="screen shot 2016-10-25 at 2 37 27 pm" src="https://cloud.githubusercontent.com/assets/13041/19686250/971bf7f8-9ac0-11e6-975c-188defd82df1.png">

## Contributing
Please see our [CONTRIBUTING.md](./CONTRIBUTING.md)
## Authors

@@ -679,0 +683,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc