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

bobril

Package Overview
Dependencies
Maintainers
1
Versions
315
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bobril - npm Package Compare versions

Comparing version 17.0.3 to 17.1.0

example.tsx

4

CHANGELOG.md
# CHANGELOG
## 17.1.0
Fixed a lot of behaviors and inApp calculation in router. Now uses history.state to remember deepness of history.
## 17.0.3

@@ -4,0 +8,0 @@

2

package.json
{
"name": "bobril",
"version": "17.0.3",
"version": "17.1.0",
"description": "Component Oriented MVC Framework with virtual DOM and CSS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -101,5 +101,9 @@ import {

let myAppStartHistory = history.length;
let historyDeepness = 0;
let programPath = "";
function history() {
return window.history;
}
function push(path: string, inApp: boolean): void {

@@ -109,3 +113,5 @@ var l = window.location;

programPath = path;
l.hash = path.substring(1);
historyDeepness++;
history().pushState({ historyDeepness }, "", path);
invalidate();
} else {

@@ -120,3 +126,4 @@ l.href = path;

programPath = path;
l.replace(l.pathname + l.search + path);
history().replaceState({ historyDeepness }, "", path);
invalidate();
} else {

@@ -128,5 +135,4 @@ l.replace(path);

function pop(distance: number) {
window.history.length;
waitingForPopHashChange = setTimeout(emitOnHashChange, 50) as unknown as number;
window.history.go(-distance);
history().go(-distance);
}

@@ -324,5 +330,17 @@

addEvent("popstate", 5, (ev: PopStateEvent) => {
let newHistoryDeepness = ev.state?.historyDeepness;
if (newHistoryDeepness != undefined) {
if (newHistoryDeepness != historyDeepness) invalidate();
historyDeepness = newHistoryDeepness;
}
return false;
});
var firstRouting = true;
function rootNodeFactory(): IBobrilNode | undefined {
if (waitingForPopHashChange >= 0) return undefined;
if (history().state == undefined && historyDeepness != undefined) {
history().replaceState({ historyDeepness: historyDeepness }, "");
}
let browserPath = window.location.hash;

@@ -345,3 +363,4 @@ let path = browserPath.substr(1);

if (!currentTransition && matches.length > 0 && browserPath != programPath) {
runTransition(createRedirectPush(matches[0]!.name!, out.p));
programPath = browserPath;
runTransition(createRedirectReplace(matches[0]!.name!, out.p));
}

@@ -572,3 +591,3 @@ }

return {
inApp: history.length - distance >= myAppStartHistory,
inApp: historyDeepness - distance >= 0,
type: RouteTransitionType.Pop,

@@ -597,3 +616,2 @@ name: undefined,

}
invalidate();
}

@@ -633,3 +651,3 @@

.catch((err: any) => {
if (typeof console !== "undefined" && console.log) console.log(err);
console.log(err);
});

@@ -674,4 +692,2 @@ return;

doAction(tr!);
} else {
invalidate();
}

@@ -714,3 +730,3 @@ currentTransition = null;

.catch((err: any) => {
if (typeof console !== "undefined" && console.log) console.log(err);
console.log(err);
});

@@ -717,0 +733,0 @@ return;

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