Skip to content

Add range with support for Lit 2 and Lit 3 #706

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

Merged
merged 14 commits into from
Feb 6, 2024

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Jan 16, 2024

Changes

  • Change "dependencies" to "peerDependencies" in order not to force lit to be installed
  • Add a range of Lit 2 - Lit 3 to be supported for UI library elements
  • Add new index.umd.ts barrel to implicitly load Lit only for the UMD bundle of the UUI package

Screenshots

npm ls on Umbraco.CMS.Backoffice:
image

runtime on Vite's dev server for Umbraco.CMS.Backoffice:
image

Caveats

It works both with Lit 2 and Lit 3. With this change, you are responsible for installing a version of Lit using the ESM version of the UI library.

You will probably start seeing warnings like this when upgrading to Lit 3 on your downstream repositories:

Field "value" on UmbUserInputElement was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit. See https://lit.dev/msg/reactive-property-without-getter for more information.

We are not upgrading the UI library itself to Lit 3 with this change (Lit is bumped to only 2.8.0 in the main package.json file). Lit 2.8.0 is now the minimum required version to run the library.

How to test

You can pack a few of the packages in the UI library locally and point Umbraco.CMS.Backoffice to the files locally:

image

You need to pack uui, uui-base and uui-css and override uui-css and uui-base with the local versions and then upgrade Lit to 3.1.1 and it should work.

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

@iOvergaard iOvergaard changed the title Feature/no implicit lit Add range with support for Lit 2 and Lit 3 Jan 16, 2024
@iOvergaard iOvergaard added enhancement New feature or request notable labels Jan 16, 2024
@iOvergaard iOvergaard marked this pull request as ready for review January 16, 2024 14:33
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

@iOvergaard iOvergaard enabled auto-merge January 16, 2024 14:58
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

1 similar comment
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

Copy link

github-actions bot commented Feb 6, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

@iOvergaard iOvergaard disabled auto-merge February 6, 2024 09:59
Copy link

github-actions bot commented Feb 6, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-706.westeurope.azurestaticapps.net

@iOvergaard iOvergaard merged commit f8ea3f0 into v1/contrib Feb 6, 2024
@iOvergaard iOvergaard deleted the feature/no-implicit-lit branch February 6, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request notable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants