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

@lit-labs/ssr

Package Overview
Dependencies
Maintainers
7
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lit-labs/ssr - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0-rc.2

7

lib/lit-element-renderer.js

@@ -8,5 +8,5 @@ /**

import { ReactiveElement } from 'lit';
import { _Φ } from 'lit-element/private-ssr-support.js';
import { _$LE } from 'lit-element/private-ssr-support.js';
import { render } from './render-lit-html.js';
const { attributeToProperty, changedProperties } = _Φ;
const { attributeToProperty, changedProperties } = _$LE;
/**

@@ -21,3 +21,4 @@ * ElementRenderer implementation for LitElements

static matchesClass(ctor) {
return ctor._$litElement$;
// This property needs to remain unminified.
return ctor['_$litElement$'];
}

@@ -24,0 +25,0 @@ connectedCallback() {

@@ -39,3 +39,3 @@ /**

['autoplay', ['audio', 'video']],
['background', ['body',]],
['background', ['body', /*'table', 'td', 'th'*/]],
[['bgcolor', 'bgColor'], ['body', /*'col', 'colgroup',*/ 'marquee', 'table', /*'tbody', 'tfoot',*/ 'td', 'th', 'tr']],

@@ -153,3 +153,3 @@ ['border', ['img', 'object', 'table']],

['translate', [ /*'*'*/]],
['type', ['button', 'input', /*'command',*/ 'embed', 'object', 'script', 'source', 'style',]],
['type', ['button', 'input', /*'command',*/ 'embed', 'object', 'script', 'source', 'style', /*'menu'*/]],
[['usemap', 'useMap'], ['img', 'input', 'object']],

@@ -156,0 +156,0 @@ ['value', ['button', 'data', 'input', 'li', 'meter', 'option', 'progress', 'param']],

/// <reference lib="dom" />
import { nothing, noChange } from 'lit';
import { PartType } from 'lit/directive.js';
import { isTemplateResult } from 'lit/directive-helpers.js';
import { _Σ } from 'lit-html/private-ssr-support.js';
const { getTemplateHtml, marker, markerMatch, boundAttributeSuffix, overrideDirectiveResolve, getAttributePartCommittedValue, resolveDirective, AttributePart, PropertyPart, BooleanAttributePart, EventPart, } = _Σ;
import { isTemplateResult, getDirectiveClass } from 'lit/directive-helpers.js';
import { _$LH } from 'lit-html/private-ssr-support.js';
const { getTemplateHtml, marker, markerMatch, boundAttributeSuffix, overrideDirectiveResolve, setDirectiveClass, getAttributePartCommittedValue, resolveDirective, AttributePart, PropertyPart, BooleanAttributePart, EventPart, connectedDisconnectable, } = _$LH;
import { digestForTemplateResult } from 'lit/experimental-hydrate.js';

@@ -23,3 +23,4 @@ import { getElementRenderer, } from './element-renderer.js';

const patchIfDirective = (value) => {
const directiveCtor = value?._$litDirective$;
// This property needs to remain unminified.
const directiveCtor = getDirectiveClass(value);
if (directiveCtor !== undefined) {

@@ -35,3 +36,4 @@ let patchedCtor = patchedDirectiveCache.get(directiveCtor);

}
value._$litDirective$ = patchedCtor;
// This property needs to remain unminified.
setDirectiveClass(value, patchedCtor);
}

@@ -118,3 +120,4 @@ return value;

}
const [html, attrNames] = getTemplateHtml(result.strings, result._$litType$);
// The property '_$litType$' needs to remain unminified.
const [html, attrNames] = getTemplateHtml(result.strings, result['_$litType$']);
/**

@@ -353,3 +356,3 @@ * The html string is parsed into a parse5 AST with source code information

else {
value = resolveDirective({ type: PartType.CHILD }, value);
value = resolveDirective(connectedDisconnectable({ type: PartType.CHILD }), value);
}

@@ -413,3 +416,3 @@ if (value != null && isTemplateResult(value)) {

// constructor
{ tagName: op.tagName }, op.name, statics, undefined, {});
{ tagName: op.tagName }, op.name, statics, connectedDisconnectable(), {});
const value = part.strings === undefined ? result.values[partIndex] : result.values;

@@ -416,0 +419,0 @@ patchAnyDirectives(part, value, partIndex);

{
"name": "@lit-labs/ssr",
"type": "module",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"publishConfig": {

@@ -11,5 +11,8 @@ "access": "public"

"scripts": {
"build": "tsc",
"build:watch": "tsc --watch",
"start": "node --experimental-vm-modules ./demo/server.js",
"build": "npm run clean && npm run build:ts",
"build:ts": "tsc",
"build:ts:watch": "tsc --watch",
"clean": "rm -rf index.js demo/ test/ lib/ *.tsbuildinfo",
"demo:vm-modules": "node --experimental-vm-modules ./demo/vm-modules/server.js",
"demo:global": "node ./demo/global/server.js",
"test": "npm run test:unit && npm run test:integration",

@@ -19,3 +22,3 @@ "test:integration": "npm run test:integration:dev && npm run test:integration:prod",

"test:integration:prod": "MODE=prod NODE_OPTIONS=--experimental-vm-modules wtr",
"test:unit": "node --experimental-vm-modules ./test/all-tests.js | tap-spec"
"test:unit": "node --experimental-vm-modules ./test/all-tests.js"
},

@@ -35,3 +38,3 @@ "files": [

"@koa/router": "^8.0.8",
"@open-wc/testing": "^2.5.8",
"@open-wc/testing": "^3.0.0-next.1",
"@open-wc/testing-karma": "^3.3.10",

@@ -50,4 +53,2 @@ "@types/chai": "^4.2.11",

"@types/resolve": "^1.14.0",
"@types/tape": "^4.2.33",
"@types/tape-promise": "^4.0.0",
"@web/test-runner": "^0.12.19",

@@ -59,6 +60,4 @@ "chai": "^4.2.0",

"mocha": "^7.1.1",
"tap-spec": "^5.0.0",
"tape": "^4.11.0",
"tape-promise": "^4.0.0",
"typescript": "^4.1.3"
"typescript": "^4.1.3",
"uvu": "^0.5.1"
},

@@ -74,3 +73,3 @@ "dependencies": {

"lit-element": "^3.0.0-rc.1",
"lit-html": "^2.0.0-rc.1",
"lit-html": "^2.0.0-rc.4",
"node-fetch": "^2.6.0",

@@ -77,0 +76,0 @@ "parse5": "^5.1.0",

@@ -89,3 +89,3 @@ # @lit-labs/ssr

When `LitElement`s are server rendered, their shadow root contents are emitted inside a `<template shadowroot>`, also known as a [Declarative Shadow Root](https://web.dev/declarative-shadow-dom/), a new browesr feature that is shipping [Chrome](https://developer.chrome.com/blog/new-in-chrome-90/#declarative). Declarative shadow roots automatically attach their contents to a shadow root on the template's parent element when parsed. For browsers that do not yet implement declarative shadow root, there is a [`template-shadowroot`](https://github.com/webcomponents/template-shadowroot) ponyfill, described below.
When `LitElement`s are server rendered, their shadow root contents are emitted inside a `<template shadowroot>`, also known as a [Declarative Shadow Root](https://web.dev/declarative-shadow-dom/), a new browser feature that is shipping [Chrome](https://developer.chrome.com/blog/new-in-chrome-90/#declarative). Declarative shadow roots automatically attach their contents to a shadow root on the template's parent element when parsed. For browsers that do not yet implement declarative shadow root, there is a [`template-shadowroot`](https://github.com/webcomponents/template-shadowroot) ponyfill, described below.

@@ -151,2 +151,2 @@ Because the `hydrate` function above does not descend into shadow roots, it only works on one scope of the DOM at a time. To hydrate `LitElement` shadow roots, load the `lit/hydrate-support.js` module, which installs support for `LitElement` automatically hydrating itself when it detects it was server-rendered with declarative shadow DOM. This module should be loaded before the `lit` module is loaded, to ensure hydration support is properly installed.

- `Directive`'s `update`
- **Patterns for usage**: As mentioned above under "Status", we intend to flesh out a number of common patterns for using this package, and provide appropriate APIs and documentation for these as the package reaches maturity. Concerns like server/client data management, incremental loading and hydration, etc. are currently beyond the scope of what this package offers, but we believe it should support building these patterns on top of it going forwrad. Please [file issues](https://github.com/Polymer/lit-html/issues/new/choose) for ideas, suggestions, and use cases you may encounter.
- **Patterns for usage**: As mentioned above under "Status", we intend to flesh out a number of common patterns for using this package, and provide appropriate APIs and documentation for these as the package reaches maturity. Concerns like server/client data management, incremental loading and hydration, etc. are currently beyond the scope of what this package offers, but we believe it should support building these patterns on top of it going forward. Please [file issues](https://github.com/lit/lit/issues/new/choose) for ideas, suggestions, and use cases you may encounter.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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