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

@ribajs/core

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ribajs/core - npm Package Compare versions

Comparing version 0.16.8 to 0.16.9

2

package.json
{
"name": "@ribajs/core",
"description": "Core module of Riba.js",
"version": "0.16.8",
"version": "0.16.9",
"author": "Pascal Garber <pascal@jumplink.eu>",

@@ -6,0 +6,0 @@ "private": false,

import Debug from 'debug';
import { RibaComponent } from './riba-component';
import { RibaComponent, IRibaComponentContext } from './riba-component';
import { View } from '../view';

@@ -11,2 +11,4 @@ import { EventHandler } from '../riba';

public context?: IRibaComponentContext;
protected debug: Debug.IDebugger;

@@ -27,3 +29,3 @@ protected view?: View;

constructor(element?: HTMLElement);
constructor(element?: HTMLElement, context?: IRibaComponentContext);

@@ -30,0 +32,0 @@ public disconnectedFallbackCallback(): void;

@@ -16,2 +16,7 @@ /**

export interface IRibaComponentContext {
fallback: boolean;
view: View;
}
export abstract class RibaComponent extends FakeHTMLElement {

@@ -21,5 +26,11 @@

/**
* Context of this component, used for debugging
*/
public context?: IRibaComponentContext;
protected debug: Debug.IDebugger;
protected view?: View;
protected _bound: boolean = false;
protected templateLoaded: boolean = false;

@@ -46,6 +57,7 @@

constructor(element?: HTMLElement) {
constructor(element?: HTMLElement, context?: IRibaComponentContext) {
super(element);
this.context = context;
this.debug = Debug('component:RibaComponent');
this.debug('constructor called', element, this);
this.debug('constructor called', element, this.context, this);

@@ -52,0 +64,0 @@ if (element) {

@@ -206,4 +206,6 @@ import { IViewOptions, Riba } from './riba';

View.debug(`Fallback for Webcomponent ${nodeName}`);
const component = new COMPONENT(node);
// TODO call disconnectedCallback for unbind
const component = new COMPONENT(node, {
fallback: true,
view: this,
});
this.webComponents.push(component);

@@ -217,7 +219,16 @@ } else {

customElements.define(nodeName, COMPONENT);
// TODO ?? call unbind (on unbind this view) of this component instance to unbind this view
// (not disconnectedCallback / disconnectedFallbackCallback, this is automatically called from customElements)
const component = customElements.get(nodeName);
component.context = {
fallback: true,
view: this,
};
} catch (error) {
console.error(error);
// Fallback
const component = new COMPONENT(node);
// TODO call disconnectedCallback for unbind
const component = new COMPONENT(node, {
fallback: true,
view: this,
});
this.webComponents.push(component);

@@ -224,0 +235,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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