Skip to content

feat: switching to use Lit table and scroll wrapper#243

Merged
dlockhart merged 2 commits intomasterfrom
use-lit
May 26, 2021
Merged

feat: switching to use Lit table and scroll wrapper#243
dlockhart merged 2 commits intomasterfrom
use-lit

Conversation

@dlockhart
Copy link
Copy Markdown
Member

These changes switch the Polymer-based table web components over to use the newly added Lit ones from core (where possible).

The <d2l-table>, <d2l-tr>, etc. elements are no longer necessary now that IE11 isn't supported, so they have not been migrated to Lit and were left mostly as-is. <d2l-table-wrapper> and <d2l-scroll-wrapper> are direct pass-throughs to the Lit versions, which will allow both the old and new to coexist.

Inline comments to follow...

@dlockhart dlockhart requested a review from svanherk May 26, 2021 13:04
@@ -1,9 +0,0 @@
.gitattributes
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This package was never published to NPM.

@@ -1,84 +0,0 @@
/*
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was only referenced from scroll-wrapper, so has been deleted.

@@ -1,71 +0,0 @@
/*
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was only referenced from scroll-wrapper, so has been deleted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@@ -1,39 +0,0 @@
/*
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was once referenced from the LMS, but that usage has been removed so deleting this file.

d2l-table[type="light"] d2l-td,
d2l-table[type="light"] d2l-th {
border-top: var(--d2l-table-light-border);
border-top: var(--d2l-table-border);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cleaned up some CSS variable use while I was in here to better mirror the variables used in the Lit versions.

--d2l-table-border-overflow: dashed 1px var(--d2l-color-mica);
--d2l-table-border-radius: 0.3rem;
--d2l-table-row-border-color-selected: var(--d2l-color-celestine);
--d2l-table-row-background-color-selected: var(--d2l-color-celestine-plus-2);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Merged these with what was in d2l-table-shared-styles.js and are defining them on the element instead of globally -- this matches how we do things in Lit as well.

@@ -1,59 +1,31 @@
<!doctype html>
<html>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There'll be lots of diffs in the demo files due to the old Polymer 3 conversion process, but I've tried to keep them mostly the same.

@@ -1,51 +0,0 @@
<!doctype html>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Deleted this demo since we no longer support these style overrides anyway.

@@ -1,74 +0,0 @@
<!doctype html>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Deleted a bunch of the other demos as they were redundant with what we have already and were created for the old Galen tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah not super concerned with full coverage here if we have it in core and the idea is to slowly remove these usages anyways

@dlockhart dlockhart marked this pull request as ready for review May 26, 2021 13:16
@dlockhart dlockhart requested a review from awikkerink as a code owner May 26, 2021 13:16
@@ -1 +1 @@
* @awikkerink
* @dlockhart
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hopefully this is OK @awikkerink! Figured you'd be happy to be off these reviews haha.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, this is fine. I haven't been working on d2l-table for a while, and I'll be happy to let it go. It's been a pain from the beginning (curse you IE11 and IE10).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Haha yes IE11 going away definitely allowed a lot of the code in here to simply be deleted.

Copy link
Copy Markdown
Contributor

@svanherk svanherk left a comment

Choose a reason for hiding this comment

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

Looks good!

@dlockhart dlockhart merged commit bf8d6d1 into master May 26, 2021
@dlockhart dlockhart deleted the use-lit branch May 26, 2021 23:56
@ghost
Copy link
Copy Markdown

ghost commented May 26, 2021

🎉 This PR is included in version 2.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ghost ghost added the released label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants