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: add custom element disambiguation #1852

Merged
merged 34 commits into from
Jan 24, 2023
Merged

Conversation

gavinbarron
Copy link
Member

Closes #1765

PR Type

Feature

Description of the changes

Adds the ability for developers to add a custom segment to the custom elements registered with the browser.
Provides a new customElement decorator to wrap the lit implementation and set tag prefixes appropriately.
Updates all usages of customElement to use the mgt specific implementation
Adds a new mgtHtml string literal tag function to dynamically rewrite mgt tags as needed at runtime which wraps the html tag function from lit
Updates SCSS to avoid using element name based CSS selectors and adds classes to elements in markup where needed.
Updates React generator script to use base tag names.
Updates Mgt React wraper to add the appropriate prefix to tags being written to the DOM.
Updates React sample app to demonstrate usage of customElementHelper.withDisambiguation('foo').

PR checklist

  • Project builds (yarn build) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)
  • All public APIs (classes, methods, etc) have been documented following the jsdoc syntax
  • Stories have been added and existing stories have been tested
  • Added appropriate documentation. Docs PR:
  • License header has been added to all new source files (yarn setLicense)
  • Contains NO breaking changes

Other information

Adds a customElementHelper to allow vendors to add a disambiguation to mgt element names
Adds a custom mgtHtml wrapper overtop of html from lit
fixed React code generation
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

The updated storybook is available here

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

The updated storybook is available here

@gavinbarron gavinbarron marked this pull request as ready for review September 9, 2022 22:40
@github-actions
Copy link

The updated storybook is available here

Copy link
Contributor

@musale musale left a comment

Choose a reason for hiding this comment

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

Fantastic work @gavinbarron looks and works well for me.

@github-actions
Copy link

The updated storybook is available here

@github-actions
Copy link

The updated storybook is available here

Copy link
Contributor

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

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

Looks really cool! From what I can see, with the default configuration it's backwards compatible, because the default prefix is mgt- but offers the ability to define a solution-specific prefix. Are there any drawbacks that you're aware of that we should into consideration?

@gavinbarron gavinbarron self-assigned this Oct 17, 2022
@github-actions
Copy link

The updated storybook is available here

@github-actions
Copy link

The updated storybook is available here

@github-actions
Copy link

The updated storybook is available here

@sebastienlevert sebastienlevert removed this from the v3.0.0 milestone Nov 29, 2022
@gavinbarron gavinbarron merged commit 5ac2099 into next/fluentui Jan 24, 2023
@gavinbarron gavinbarron deleted the next/wc-registration branch June 27, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use MGT in SharePoint tenants with and without the mgt-spfx library package installed
4 participants