gecko-dev/toolkit/content/vendor/lit
Mark Striemer a610fd5886 Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley
lit calls `element.setAttribute("style", "<our styles>")` on first render of an
element so that it will have the style property set in the markup if it is being
server-side rendered. We don't need that, and it causes CSP errors in
about:logins so this patches out the functionality.

https://github.com/lit/rfcs/issues/13

Differential Revision: https://phabricator.services.mozilla.com/D165240
2023-01-09 22:20:21 +00:00
..
lit Bug 1790483 - Vendor the lit library in toolkit/content/widgets r=hjones 2022-12-07 15:46:06 +00:00
0001-disable-terser-step.patch Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00
0002-use-DOMParser-not-innerHTML.patch Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00
0003-Disable-source-maps.patch Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00
0004-Remove-the-bundled-warning.patch Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00
0005-Bug-1808741-Do-not-set-style-attributes-when-using-s.patch Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00
LICENSE Bug 1790483 - Vendor the lit library in toolkit/content/widgets r=hjones 2022-12-07 15:46:06 +00:00
README.md Bug 1790483 - Vendor the lit library in toolkit/content/widgets r=hjones 2022-12-07 15:46:06 +00:00
bundle-lit.sh Bug 1790483 - Vendor the lit library in toolkit/content/widgets r=hjones 2022-12-07 15:46:06 +00:00
moz.yaml Bug 1808741 - Patch lit's styleMap to not set the style attribute on first render r=mtigley 2023-01-09 22:20:21 +00:00

README.md

Vendoring for lit

lit can be used to help create Web Components.

The lit.all.mjs bundle

The lit package is imported in a vendoring step and the contents are extracted into the lit.all.mjs file. This has some differences from using lit in a regular npm project. Imports that would normally be into a specific file are pulled directly from the lit.all.mjs file.

eg.

// Standard npm package:
import { LitElement } from "lit";
import { classMap } from "lit/directives/class-map.js";

// Using lit.all.mjs (pathing to lit.all.mjs may differ)
import { classMap, LitElement } from "../vendor/lit.all.mjs";

## To update the lit bundle

Vendoring runs off of the latest tag in the https://github.com/lit/lit repo. If
the latest tag is a lit@ tag then running the vendor command will update to that
version. If the latest tag isn't for lit@, you may need to bundle manually. See
the moz.yaml file for instructions.

### Using mach vendor

./mach vendor toolkit/content/vendor/lit/moz.yaml hg ci -m "Update to lit@"


### Manually updating the bundle

To manually update, you'll need to checkout a copy of lit/lit, find the tag you
want and manually run our import commands.

  1. Clone https://github.com/lit/lit outside of moz-central
  2. Copy *.patch from this directory into the lit repo
  3. git apply *.patch
  4. npm install && npm run build
  5. Copy packages/lit/lit-all.min.js to toolkit/content/widgets/vendor/lit.all.mjs
  6. hg ci -m "Update to lit@<version>"