-
Notifications
You must be signed in to change notification settings - Fork 96
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
β‘ PatternFly Elements 2.0: Lit, TypeScript, pfe-tools, and more #1804
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
work in progress
POC / Not ready for review
AT passed
Automated testing has passed
demo
Updating demo pages
docs
Documentation updates
styles
An issue or PR pertaining only to CSS/Sass
tests
Related to testing
labels
Oct 25, 2021
github-actions
bot
added
functionality
Functionality, typically pertaining to the JavaScript.
tools
Development and build tools
labels
Oct 25, 2021
18 tasks
bennypowers
force-pushed
the
feat/pfe-tools
branch
from
October 31, 2021 18:29
3dc5f2a
to
76c306c
Compare
Heads up to everyone following this branch, I just rebased and force pushed in order to organize the commit history. It should be much easier to follow the progression of commits now, but it does mean you should fetch and reset your local branch |
bennypowers
force-pushed
the
feat/pfe-tools
branch
15 times, most recently
from
November 5, 2021 13:02
d898827
to
0243f5a
Compare
**Fixes** - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset
**Features** - add parts for wrapper elements, updated docs (#1836) - add {{version}} to element classes **Tests** - e2e tests with page object model **Breaking Changes** - remove public `has_` attrs **Docs** - fix demo - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - synchronize `type` attr **Breaking Changes** - use ::slotted button instead of copying button into shadow DOM **Fixes** - slotted button styles - add {{version}} to element classes - reflect disabled attribute - rename `pfeEvent` to `deprecatedCustomEvent` **Tests** test(button): e2e tests test(button): e2e tests with page object model **Docs** - todo for context support - fix demo - inline docs - add changeset
**Features** - add parts to card - update docs (#1842) - transfer css props from docs to CEM - chore: fix href in demo - add {{version}} to element classes **Fixes** - make imgSrc optional **Tests** - adjust test for changes in slot controller - e2e tests with page object model **Breaking Changes** - remove public `has_` attrs **Docs** - inline docs - refactor docs page - add changeset - document CSS parts - fix a11y bugs in demo - use pfe-styles - simplify demo Co-Authored-By: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - updated size of copy icon for Safari display (#1824) **Fixes** - hide deprecated slot when not in use - add CopiedEvent - rename `pfeEvent` to `deprecatedCustomEvent` - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - fix a11y bugs in demo - use pfe-styles - add changeset Co-Authored-By: Rob Lahoda <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts - remove `<slot>` - remove unused private `codeblock-render` attr - simplify class methods with computed render vars - add {{version}} to element classes **Tests** - e2e tests with page object model **Docs** - rearrange docs urls - fix demo - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - `expand()` and `collapse()` methods **Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - do not export styles - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - add changeset
**Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - add {{version}} to element classes - removed duplicate event listener in connectedCallback - add lightdom CSS build script **Docs** - rearrange docs urls - add changeset - use pfe-styles **Tests** - e2e tests with page object model - build demo with optional shadowroot Co-Authored-By: Steven Spriggs <[email protected]> Co-Authored-By: Kyle Buchanan <[email protected]>
**Fixes** - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles - update changeset Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - switched to options in docs. Added public expanded property. Updated tests - add CSS shadow parts **Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - remove extra focus() method - use focus-within in item - moved public focus method to private. (#1851) - add {{version}} to element classes - add guard for item clicks - prev next keyboard actions for items - fixed keyboard navigation. added tests to cover a11y tests - added better tests, weeded out race conditions **Tests** - e2e tests - fix types in e2e tests - e2e tests with page object model - build demo with optional shadowroot - pick nits in dropdown tests **Docs** - rearrange docs urls - inline docs - add changeset - use pfe-styles Co-Authored-By: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts - add {{version}} to element classes **Tests** - e2e tests with page object model **Docs** - rearrange docs urls - fix demo - update inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - fix demo - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts - add {{version}} to element classes **Tests** - e2e tests with page object model **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - support multiple nested scroll containers - migrate events to ComposedEvent - changed event names/types for change, stuck & content-change. Updated tests - add CSS parts **Fixes** - enable offset to be set to zero - accent-bar mixin wasn't setting proper width - remove duplicate background-color property. - prevent uncaught error - declare Breakpoints interface locally - add {{version}} to element classes - rename `pfeEvent` to `deprecatedCustomEvent` - type of ActiveItemEvent param - align styles to match red hat designs **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - doc updates and fixes (#1829) - update docs - update demo file - remove old demo sticky nav - remove old demo panel offset - rearrange docs urls - if there are no links and autobuild is unset - inline docs - rewrite docs page - add changeset - use pfe-styles Co-Authored-By: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]> Co-Authored-By: Daniel Faucette <[email protected]>
**Features** - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot - rename element instance in tests - pfeAccordion => element **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Breaking Changes** - implement HTMLDialogElement interface. See changelog for more info **Features** - add CSS parts **Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - remove public has_ attrs - add {{version}} to element classes **Docs** - rearrange docs urls - inline docs - add changeset - use pfe-styles **Tests** - e2e tests with page object model - build demo with optional shadowroot **Refactorings** - handle side effects in lifecycle Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add {{version}} to element classes **Fixes** - remove `on` attr when context is null **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - fix a11y bugs in demo - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS part - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - Move header and options select inside pfe-band - improve demo - use pfe-styles Co-Authored-By: Em Nouveau <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts **Fixes** - bad aria-expanded attribute - Was being set to an ID, should be true or false - Inline attribute in template markup was producing odd results, moved to ye ole fashioned JS - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - simplify back button text and remove unused functions - Removed aria attributes from element surrounding text, only need htose on the button wrapper - Set back button text to property so we aren't reading the DOM during render (? seems like the that's recommended) - Removed unused functions made during original development, but are now unused - Updated Demo HTML, thought text in 'details' was a bug in functionality, but was content in the slot. Hopefully the slight adjustment makes that more clear. - null checks - catch errors in render cycle - add {{version}} to element classes - fix animations, move breakpoint prop to private - remove scss causing extra border - refactor primary-detail **Tests** - update snapshot - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - refactor demo - inline docs - add changeset - use pfe-styles Co-Authored-By: Wes Ruvalcaba <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - allow text fallback - add {{version}} to element classes **Tests** - e2e tests with page object model **Docs** - fix demo - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts - add {{version}} to element classes **Fixes** - remove erroneous count property (#1822) - remove `has_` attrs **Docs** - added pfe-progress-steps-item slots to docs (#1825) - fix demo - inline docs - refactor docs page - add changeset - update inline docs - use pfe-styles - update slot definitions for docs (#1823) **Tests** - e2e tests with page object model Co-authored-by: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Breaking Changes** - make readtime prop readonly **Features** - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - fix demo - inline docs - refactor docs page - add changeset - use pfe-styles Co-authored-by: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add `value` property **Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - add {{version}} to element classes **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts **Fixes** - add {{version}} to element classes - rename `pfeEvent` to `deprecatedCustomEvent` **Tests** - e2e tests with page object model - build demo with optional shadowroot **Docs** - add CSS to demo page for tabs (#1835) - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles Co-Authored-By: Steven Spriggs <[email protected]>
**Features** - add CSS parts - add static `toast(text)` method - allows users to create an ephemeral toast via JS **Fixes** - compose UI events - rename `pfeEvent` to `deprecatedCustomEvent` - add {{version}} to element classes **Docs** - 2.0 [pfe-toast] update docs (#1826) - pfe-toast update docs - add .no-header-styles opt-out class for headers - rearrange docs urls - inline docs - refactor docs page - add changeset - use pfe-styles **Tests** - e2e tests with page object model - build demo with optional shadowroot Co-Authored-By: Michael Potter <[email protected]> Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers
force-pushed
the
feat/pfe-tools
branch
from
February 23, 2022 16:15
7502dd5
to
6d9e592
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
AT passed
Automated testing has passed
demo
Updating demo pages
docs
Documentation updates
functionality
Functionality, typically pertaining to the JavaScript.
generator
Updates relating to the generator
styles
An issue or PR pertaining only to CSS/Sass
tests
Related to testing
tools
Development and build tools
work in progress
POC / Not ready for review
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π₯ π΅ Migrate to Lit β‘ π§
This PR aims to massively overhaul the PatternFly Elements codebase: updating it, reducing its complexity, and improving both the user's and the contributor's experience
Sticky Notes
What has changed and why
Adopt TypeScript
TypeScript allows us to find and eliminate bugs before they hit production. In the process of converting components, several of these types of problems were identified and ameliorated. TypeScript also lets us develop faster and with confidence, as the objects in our project and their behaviour are now are well-defined. As well, adopting TypeScript is an a11y feature for contributors, as the IDE features of ts language server let them access information about the objects 'under their cursor' faster, without having to page back and forth between docs (as much)
Adopt Custom Elements Manifest
This PR removes the custom manifest schema developed for PFE in favour of the custom elements manifest, a community standard for documenting javascript packages, particularly geared to web components. By documenting our components in the manifest, tooling such as docs-site generators and IDEs will be able to understand the contents of our components and their abilities without requiring us to ship that code over the wire to end users.
In particular, our 11ty docs site now uses the generated manifests to generate docs pages.
Removed
PFElement
base class and package in favour ofLitElement
The
PFElement
base class implemented a wide variety of features, some related to DOM templating and component lifecycle, others related to analytics, still more related to 'colour context'. The DOM templating and component lifecycle features are the main reason we're switching to Lit - they are well maintained there, so removing that code from PFE frees us up to 'move up the stack' and focus on UI problems. Other features like colour context, analytics events, etc, could therefore be replaced by reactive controllers and typescript decorators, allowing component authors to add them to elements a la carte. This will result in smaller javascript payloads for some pagesRename slots and events
Slot names like
pfe-card--header
have been renamed to simplyheader
. This is in line with web components community best practices and conventions and simplifies element APIs, amking them easier to use.The old slots will still work, until the next major version, so upgrading should be smooth.
Rename events and deprecate
CustomEvent
CustomEvent
is a throwback to a time when the spec did not allow us to subclassEvent
. Now that we can, we can prefer to define our own event classes. This lets us validate event's data at run time, use instanceof to validate them in listeners, and generally improve API readability. Events are still composed, so analytics code should be able to pick them up.As well, events like
pfe-clipboard:copied
are renamed (in their new form) tocopied
, for simplicity, and framework compatibility.The old CustomEvent-based events are still used, under their old names, until the next version, to aid in migration
Adopt a 'buildless' development workflow
Contributors no longer need to keep a file watcher to re-compile components when working on elements. Instead, source files (typescript and sass) are compiled on-the-fly by the dev server. Just install dependencies and run
npm start
Adopt Playwright for E2E and visual regression tests
Update to
dart-sass
node-sass
is deprecated. Updating to dart-sass improved performance and made new language features available.Rewrite the element generator
Removed the dependency on yeoman and rewrote the element generator to generate LitElements for PFE. once published, contributors will be able to
npm init @patternfly/element
Add
@patternfly/pfe-tools
Users wishing to develop their own set of elements based on patternfly will be able to clone a template repo and import tooling helpers from
@patternfly/pfe-tools
. This will include things likeAdd Linting Rules
This PR adds eslint rules for PFE. It's recommended to install an ESLint plugin for your editor and enable "fix on save"
Remove
<pfe-navigation>
The decision was taken to move pfe-navigation downstream to red hat's design system. This frees up PFE to concentrate on lower-level components
Add Lighthouse Testing in CI
PRs will now be tested using lighthouse against each element's demo page and the results formatted and printed to the PR thread
Commitlint Reporting
Commitlint errors and warnings will now be reported to the PR thread.
Testing instructions
git fetch && git reset --hard origin/feat/pfe-tools
npm ci && npm start
Review Work Assignments
Check the box and tag your GitHub user to claim an element for review.
Core
Elements
Ready-for-merge Checklist
or scope-creep).Related issues
engines
blocks yarn install, adds warning to npm installΒ #1744)Preview
Merging
Please rebase when merging and ensure your commit messages use conventional commit formatting.
Be sure to share your updates with the [email protected] mailing list!