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

feat (esco-content-menu) : Lit version of the component #919

Draft
wants to merge 134 commits into
base: master
Choose a base branch
from

Conversation

gbrousse-recia
Copy link
Contributor

Lit version of the esco-content-menu component

@jgribonvald jgribonvald changed the title Feat (esco-content-menu) : Lit version of the component feat (esco-content-menu) : Lit version of the component Jun 17, 2022
@jgribonvald jgribonvald force-pushed the feat-esco-content-menu-lit branch 6 times, most recently from c8f257b to 7e8821b Compare June 17, 2022 15:52
Copy link
Contributor

@jgribonvald jgribonvald left a comment

Choose a reason for hiding this comment

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

@bjagg @ChristianMurphy @cbeach47 do you have feedback around this change ? We need to remove old browsers, and IE support should go out !

Copy link
Contributor

@cbeach47 cbeach47 left a comment

Choose a reason for hiding this comment

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

Thanks @jgribonvald ! It's impressive - I haven't add a chance to run this locally yet, or dig too deep in the code, but added some inline comments.

For the readme, I would do a doc-wide find/replace for Emited/emited and replace with Emitted/Emitted .

@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved

- `messages`: type: `Array of Objects`, see [internationalization](#internationalization)
- `context-api-url`: type: `String`, default: `/uPortal`, usefull to provide a different uPortal context on which to do request
- `favorite-api-url`: type: `String`, default: `/uPortal/api/layout`, the uri/url of the favorites api
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice that this is separated out - /api/portlet-list is in the works!

Copy link
Contributor

@jgribonvald jgribonvald Aug 22, 2022

Choose a reason for hiding this comment

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

@cbeach47 Yes but there is a breaking change, the ordering isn't managed by code and I think that the json format isn't the same... And in waiting an improvment the ordering is assured by adding always at the end of the list the new favorite, hibernate keep the ordering from list and your new code add this param.

@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved

### The content favorites

The component is functional only into the `content-menu`, it needs that a portlet list and favorite list is passed
Copy link
Contributor

Choose a reason for hiding this comment

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

What is 'portlet list', ie which api does it come from?

Copy link
Contributor

Choose a reason for hiding this comment

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

The portlet list is only an array passed to the component, so it's resolved from a parent component and using a service class that resolve from the current portlet api system.

@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/README.md Outdated Show resolved Hide resolved
@gbrousse-recia gbrousse-recia force-pushed the feat-esco-content-menu-lit branch 3 times, most recently from 8efbbc9 to b74c325 Compare August 23, 2022 10:17
Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

Welcome @gbrousse-recia! Thank you for looking into this!
Broadly I'm excited to move away from the deprecated version on Vue and on to lit.
A few points of discussion towards the approach below.

Comment on lines +1 to +9
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
Copy link
Member

Choose a reason for hiding this comment

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

is this needed with prettier also being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a good complement to prettier and eslint, allowing all developers to have the same configuration in their ide

@uportal/esco-content-menu-lit/.eslintignore Show resolved Hide resolved
@uportal/esco-content-menu-lit/src/content-favorites.ts Outdated Show resolved Hide resolved
@uportal/esco-content-menu-lit/webpack.config.js Outdated Show resolved Hide resolved
"sass-loader": "^13.0.0",
"terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.3.0",
"typescript": "^4.7.3",
Copy link
Member

Choose a reason for hiding this comment

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

Happy to see typescript integrated to ensure variables are typed and APIs/interfaces are clearly defined 👍

"terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.3.0",
"typescript": "^4.7.3",
"webpack": "^5.73.0",
Copy link
Member

@ChristianMurphy ChristianMurphy Aug 23, 2022

Choose a reason for hiding this comment

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

I'm a bit cautious using webpack here.
Vue CLI is/was also webpack based, and even through it provided good defaults, it was still a pain to maintain.
The deep dependency tree frequently has vulns which cause noise as dependabot and renovate bot try to respond.
WebPack had (and may still have) issues around handling code in ESM format.
And when custom configuration is needed, it can be rather verbose and circuitous.

While not a blocker.
I'd lean strongly towards moving to another build system like:

return false;
}

willUpdate(changedProperties: Map<string | number | symbol, unknown>): void {
Copy link
Member

Choose a reason for hiding this comment

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

Another area which could be fine here.
But may want to be discussed further.
Does it make sense to stick with lifecycle based design for components?

The hooks based model has taken both React and Vue over, and can be supported in Lit as well https://github.com/matthewp/haunted#readme

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

regarding 3256431, we probably don't want to commit dist files/folders?
Those are generally only sent to a package registry like npm or GitHub packages.
Keeping them in source control introduces risk that the wrong file could be edited, and the change could be overriden/not applied.

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.

None yet

4 participants