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

@lit-labs/ssr

Package Overview
Dependencies
Maintainers
11
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 3.2.0 to 3.2.1

20

lib/render-value.js

@@ -10,3 +10,3 @@ /// <reference lib="dom" />

import { escapeHtml } from './util/escape-html.js';
import { parseFragment } from 'parse5';
import { parseFragment, parse } from 'parse5';
import { isElementNode, isCommentNode, traverse, isTextNode, isTemplateNode, } from '@parse5/tools';

@@ -116,3 +116,3 @@ import { isRenderLightDirective } from '@lit-labs/ssr-client/directives/render-light.js';

*/
const getTemplateOpcodes = (result) => {
const getTemplateOpcodes = (result, isServerTemplate = false) => {
const template = templateCache.get(result.strings);

@@ -122,3 +122,2 @@ if (template !== undefined) {

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

@@ -134,4 +133,7 @@ // SVG TemplateResultType functionality is only required on the client,

* while walking the AST.
*
* Server Templates need to use `parse` as they may contain document tags such
* as `<html>`.
*/
const ast = parseFragment(String(html), {
const ast = (isServerTemplate ? parse : parseFragment)(String(html), {
sourceCodeLocationInfo: true,

@@ -258,6 +260,2 @@ });

const strings = attr.value.split(marker);
// We store the case-sensitive name from `attrNames` (generated
// while parsing the template strings); note that this assumes
// parse5 attribute ordering matches string ordering
const name = attrNames[attrIndex++];
const attrSourceLocation = node.sourceCodeLocation.attrs[attr.name];

@@ -268,2 +266,6 @@ const attrNameStartOffset = attrSourceLocation.startOffset;

if (isAttrBinding) {
// We store the case-sensitive name from `attrNames` (generated
// while parsing the template strings); note that this assumes
// parse5 attribute ordering matches string ordering
const name = attrNames[attrIndex++];
const [, prefix, caseSensitiveName] = /([.?@])?(.*)/.exec(name);

@@ -455,3 +457,3 @@ if (!hydratable) {

const hydratable = isHydratable(result);
const ops = getTemplateOpcodes(result);
const ops = getTemplateOpcodes(result, !hydratable);
/* The next value in result.values to render */

@@ -458,0 +460,0 @@ let partIndex = 0;

{
"name": "@lit-labs/ssr",
"type": "module",
"version": "3.2.0",
"version": "3.2.1",
"publishConfig": {

@@ -6,0 +6,0 @@ "access": "public"

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