Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Stock Lit #49

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Use Stock Lit #49

wants to merge 3 commits into from

Conversation

strseb
Copy link
Collaborator

@strseb strseb commented Sep 2, 2024

Note that non-release versions of third-party libraries are not accepted.
https://extensionworkshop.com/documentation/publish/third-party-library-usage/

Given we patched lit to only fix a warning, let's pull an official release from an official source and live with that warning. Given that we can point to https://lit.dev/docs/templates/expressions/ and the fact that we don't use any of the unsafe* directives.
(Spoiler: We dont even ship those anymore.)

Idea 1: Use lit-all-min.js:
Well the bundle comes from https://cdn.jsdelivr.net/gh/lit/dist@3/all/lit-all.min.js
And the rules are clear about CDN's

You should download third-party libraries from their official site, not from a CDN or other location.

It is unclear what the rule is, if lit is actually endorcing a cdn... 🤷 - This might be a good plan b.

Idea 2: Use NPM.
We cannot use the npm lit.js files directly. They are expecting to have a global resolving scope. i.e lit.js is importing "@lit/reactive-element". For this type of import we would need to use a source-map. They are blocked however due to the fact that every Webextension has a default csp script-src "self" . Even after changing the manifest csp to allow eval, the import map did not apply. I meed night file a bug... Also using nonce's are not allowed.

Therefore!

... These processes include minifying your code, as well as the use of module bundlers or similar tools, such as webpack.

Using a bundler is not forbidden. i.e there even is an official webpack plugin. So i quickly use rollup to create a loadable bundle when you do npm install.

Copy link
Member

@lesleyjanenorton lesleyjanenorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R+ but let's just verify again tomorrow that we really have/want to use Stock Lit before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants