-
Notifications
You must be signed in to change notification settings - Fork 12
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(components): enable prefix override #861
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ea5dd60
feat(components): enable prefix override
yinonov 1372d88
custom prefix available
yinonov 657ae81
dynamic imports
yinonov 6eddd7d
await dynamic imports
yinonov 4f38f33
Change files
yinonov 3e998af
irrelevant
yinonov d1ea78c
build issues
yinonov f97f3f7
document custom prefix
yinonov 4c1b912
add usage
yinonov a3970cb
revert banner
yinonov 3611bad
ts-jest-mock-import-meta
yinonov ba72866
deduping
yinonov 95785f4
menu needs focus
yinonov db10a97
Merge remote-tracking branch 'origin/main' into prefix-override
yinonov fae789c
progress?
olaf-k 5a590bb
Solve for button
YonatanKra e93fbdd
Use with `whenDefined`
YonatanKra 4a3f5ff
simpler
yinonov 1c0e18b
natural order of code
yinonov c69efa8
Generalize the utils mock
YonatanKra bb2cb0d
Mid fix
YonatanKra 8a4e45c
Fix top-level await for all
YonatanKra 90f420a
more accurate
yinonov ca7039c
resolve again with whenDefined
yinonov 040e66e
align
yinonov 142f234
done
yinonov 76a207d
natural order
yinonov fc6e88e
listbox to option
yinonov bf53a2b
mixins issue
yinonov c4fec0a
Merge branch 'yonatan-prefix-override-workaround' into prefix-override
yinonov 573aa57
path revert
yinonov e20a254
revert path
yinonov 7df4636
Merge remote-tracking branch 'origin/main' into prefix-override
yinonov 6199075
revert format
yinonov c230c1b
test loadComponentsModules
yinonov 70f2012
Passing test
YonatanKra c565156
format
yinonov 8c5b6a1
Refactor
YonatanKra d68504f
Merge branch 'prefix-override' of https://github.com/Vonage/vivid-3 i…
YonatanKra 1efe0e2
Formatting
YonatanKra 5c92210
Refactor
YonatanKra 9aef3f5
Fix type
YonatanKra 6a440dd
Merge branch 'main' into prefix-override
YonatanKra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
change/@vonage-nx-vivid-138899ae-8f78-49cb-8e9b-c1e17817ea91.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comment": "align with custom prefix for custom-elements support", | ||
"type": "none", | ||
"packageName": "@vonage/nx-vivid", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@vonage-vivid-dcd48901-44d8-4cd1-82fb-dca16b03db6f.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "enable custom prefix for custom-elements", | ||
"packageName": "@vonage/vivid", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ describe('vwc-accordion', () => { | |
let accordionItem1: AccordionItem; | ||
let accordionItem2: AccordionItem; | ||
|
||
beforeAll(async () => { | ||
await customElements.whenDefined(COMPONENT_TAG); | ||
}); | ||
|
||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? |
||
beforeEach(async () => { | ||
element = (await fixture( | ||
`<${COMPONENT_TAG}> | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ describe('vwc-avatar', () => { | |
let baseElement: Element; | ||
let element: Avatar; | ||
|
||
beforeAll(async () => { | ||
await customElements.whenDefined(COMPONENT_TAG); | ||
}); | ||
|
||
Comment on lines
+12
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question |
||
beforeEach(async () => { | ||
element = (await fixture( | ||
`<${COMPONENT_TAG}></${COMPONENT_TAG}>` | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import '../icon'; | ||
|
||
import type { FoundationElementDefinition } from '@microsoft/fast-foundation'; | ||
import { designSystem } from '../../shared/design-system'; | ||
import { designSystem, getPrefix } from '../../shared/design-system'; | ||
import { loadComponentsModules } from '../../shared/utils'; | ||
import styles from './avatar.scss'; | ||
|
||
import { Avatar } from './avatar'; | ||
import { AvatarTemplate as template } from './avatar.template'; | ||
|
||
const prefix = getPrefix(import.meta.url); | ||
const dependencies = ['icon']; | ||
|
||
export const vividAvatar = Avatar.compose<FoundationElementDefinition>({ | ||
baseName: 'avatar', | ||
template: template as any, | ||
styles, | ||
}); | ||
|
||
designSystem.register(vividAvatar()); | ||
(async () => { | ||
await loadComponentsModules(dependencies, prefix); | ||
designSystem.withPrefix(prefix).register(vividAvatar()); | ||
})(); |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import '../button'; | ||
|
||
import type { FoundationElementDefinition } from '@microsoft/fast-foundation'; | ||
import { designSystem } from '../../shared/design-system'; | ||
import { designSystem, getPrefix } from '../../shared/design-system'; | ||
import { loadComponentsModules } from '../../shared/utils'; | ||
import styles from './banner.scss'; | ||
|
||
import { Banner } from './banner'; | ||
import { BannerTemplate as template } from './banner.template'; | ||
|
||
const prefix = getPrefix(import.meta.url); | ||
|
||
export const vividBanner = Banner.compose<FoundationElementDefinition>({ | ||
baseName: 'banner', | ||
template: template as any, | ||
styles, | ||
}); | ||
|
||
designSystem.register(vividBanner()); | ||
(async () => { | ||
await loadComponentsModules(['button'], prefix); | ||
designSystem.withPrefix(prefix).register(vividBanner()); | ||
})(); |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not needed now as we have this code in the pattern itself, right?