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

add anchor as a new component to support anchor-button scenario #27395

Conversation

chrisdholt
Copy link
Member

Naming

For a variety of reasons, supporting two separate semantic elements within the ShadowDOM of a web component is less than ideal. With that, we need to find an approach to support scenarios for elements which functionally and semantically are anchors, but appear like a button.

From a verbosity standpoint, "anchor button" is the semantic that we tend to use to describe these. Fluent UI React v9 utilizes "as" to shorthand this assignment. Given this needs to be a separate HTML element, I'm proposing a shorter name than anchor-button and utilizing a class and tag name of simply <fluent-anchor>. A few key reasons for this:

  • Anchor already exists in Fluent UI Web Components (stable) using the same semantic, construct, and approach.
  • Anchor is shorter to write and less verbose considering devx and convenience
  • There is no conflicting namespace. "Anchor" isn't a construct in Fluent components and "link" conveys a different semantic meaning.

Overall, it seems reasonable to simply go with the shorter name as it maintains an existing approach, there are no semantic conflicts in Fluent, and it's just plain easier and shorter to write.

Related Issue(s)

  • Fixes #

@fabricteam
Copy link
Collaborator

fabricteam commented Mar 31, 2023

📊 Bundle size report

🤖 This report was generated against 37195a34b36538ab0cc7c765824691bab796502e

@size-auditor
Copy link

size-auditor bot commented Mar 31, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 37195a34b36538ab0cc7c765824691bab796502e (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 31, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d3f85c0:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

There is no conflicting namespace. "Anchor" isn't a construct in Fluent components and "link" conveys a different semantic meaning.

So we will have fluent-anchor (which looks like a button) and intrinsic a. If we ever add fluent-link my head will explode.

@chrisdholt
Copy link
Member Author

There is no conflicting namespace. "Anchor" isn't a construct in Fluent components and "link" conveys a different semantic meaning.

So we will have fluent-anchor (which looks like a button) and intrinsic a. If we ever add fluent-link my head will explode.

I guess “link” is a legit instance and appearance we need to adopt isn’t it? I’m open to “anchor-button” but also, yuck!

@miroslavstastny
Copy link
Member

There is no conflicting namespace. "Anchor" isn't a construct in Fluent components and "link" conveys a different semantic meaning.

So we will have fluent-anchor (which looks like a button) and intrinsic a. If we ever add fluent-link my head will explode.

I guess “link” is a legit instance and appearance we need to adopt isn’t it? I’m open to “anchor-button” but also, yuck!

I would understand the anchor-button more (because that's what it is). But will leave it up to you.

@chrisdholt
Copy link
Member Author

There is no conflicting namespace. "Anchor" isn't a construct in Fluent components and "link" conveys a different semantic meaning.

So we will have fluent-anchor (which looks like a button) and intrinsic a. If we ever add fluent-link my head will explode.

I guess “link” is a legit instance and appearance we need to adopt isn’t it? I’m open to “anchor-button” but also, yuck!

I would understand the anchor-button more (because that's what it is). But will leave it up to you.

Given we have fluent-compound-button, fluent-anchor-button seems reasonable in terms of verbosity :).

@chrisdholt chrisdholt force-pushed the users/chhol/add-anchor-button-to-wc-v3 branch from e425bb8 to de77904 Compare April 11, 2023 17:51
@chrisdholt chrisdholt merged commit 5ab8f95 into microsoft:web-components-v3 Apr 11, 2023
@chrisdholt chrisdholt deleted the users/chhol/add-anchor-button-to-wc-v3 branch April 11, 2023 18:16
chrisdholt added a commit that referenced this pull request Apr 29, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
…27395)

* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
…27395)

* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 30, 2024
…27395)

* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request Apr 30, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 2, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 2, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 2, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 3, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 6, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 6, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 8, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
radium-v pushed a commit that referenced this pull request May 10, 2024
* add anchor as a new component to support anchor-button scenario

* dont forget managing anchor disabled

* update naming to anchor button

* Update change/@fluentui-web-components-b7e6d7ad-6aac-4ccb-b7ee-97424d76f9a2.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants