Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…cularly on the web component side.
…or compiler testing, iteration, and validation.
e91f51a to
a919f39
Compare
| @@ -0,0 +1,136 @@ | |||
| import type { PropsWithChildren } from 'react'; | |||
There was a problem hiding this comment.
Don't worry about maintaining these or keeping them in sync with skin updates/refactors. Here primarily for compiler iteration, validation, and other testing.
| }, | ||
| "dependencies": { | ||
| "@vjs-10/react": "workspace:*", | ||
| "@vjs-10/react-icons": "workspace:*", |
There was a problem hiding this comment.
Added to test in-app defined skins.
|
|
||
| // Register the custom element | ||
| if (!globalThis.customElements.get('media-current-time-display')) { | ||
| // @ts-ignore - Custom element constructor compatibility |
There was a problem hiding this comment.
Some eslint error strays I caught. Sorry for the noise!
|
|
||
| #setupPortal(): void { | ||
| const portalId = this.getAttribute('root-id'); | ||
| const portalId = this.getAttribute('root-id') ?? '@default_portal_id'; |
There was a problem hiding this comment.
This and the corresponding changes in react, as well as the related changes to the respective media containers, are very much a stopgap. We need to build a "real architecture" here, and hopefully can use media container as the default owner of (at least tooltip-related) portals to simplify use cases. Done for now to simplify problem space for complier.
| return /* html */ ` | ||
| <slot name="media"></slot> | ||
| <slot></slot> | ||
| <div id="@default_portal_id" style={ position: absolute; zIndex: 10; }> |
There was a problem hiding this comment.
Dum dum solution for default portals. slot bits were due to styling inheritance between skin-defined tooltip styles vs. container component shadow dom-defined portal root (and css boundaries implicated therein). On @mihar-22's radar as a tough problem that needs to be figured out.
| customElements.define('media-container', MediaContainer); | ||
| // Register the custom element | ||
| if (!globalThis.customElements.get('media-container')) { | ||
| // @ts-expect-error ts(2345) |
There was a problem hiding this comment.
We need to carve out time to fix all of our TS woes at some point...
| @@ -1,5 +1,4 @@ | |||
| import { MediaSkin } from '../media-skin'; | |||
| import { uniqueId } from '../utils/element-utils'; | |||
|
|
|||
There was a problem hiding this comment.
simplified skin for compiler
| <div ref={composedRef} {...props}> | ||
| {children} | ||
| {/* @TODO We need to make sure this is non-brittle longer term (CJP) */} | ||
| <div id={portalId} style={{ position: 'absolute', zIndex: 10 }} /> |
There was a problem hiding this comment.
same as above convo (though react side required less hackrobatics. Thoughts on the table are using context providers and consumers for some of these hack-ins.
| <PlayButton className={`${styles.Button} ${styles.IconButton} ${styles.PlayButton}`}> | ||
| <PlayIcon className={styles.PlayIcon}></PlayIcon> | ||
| <PauseIcon className={styles.PauseIcon}></PauseIcon> | ||
| <PlayIcon className={`${styles.PlayIcon} ${styles.Icon}`} /> |
There was a problem hiding this comment.
skin simplification for compiler. Used for descendant selectors (previously used svg, which is not appropriately equivalent for html/web component equivalent).
| @@ -1,180 +0,0 @@ | |||
| /** @TODO: Improve/Polish CSS Here */ | |||
There was a problem hiding this comment.
Removing to avoid repo noise. It's in history if we ever want/need to refer back.
| import type { MediaDefaultSkinStyles } from './types'; | ||
|
|
||
| import { cn } from '../../utils/cn'; | ||
| // NOTE: Removing import to sidestep for compiler complexity (CJP) |
There was a problem hiding this comment.
Skin styles simplification for compiler. TL;DR:
- imports would need to be pulled in as well. Longer term we may want to either solve this or just bake in some common css+js(x) utils into the compiler (
cn,clsx, maybe others) - Make sure non-tailwind-utility classes correspond with key names.
- Avoid selectors that use element names, since they may not be appropriately equivalent when cross-compiling, especially for VJS components (e.g.
[&_svg]vs. addedIcon: cn('icon')+[&_.icon]) - If key names are intended to correspond with component names, try to make them be exact matches (e.g.
FullScreenvs.Fullscreen. Previously alsoVolumeButtonvs.MuteButton,TimeSlidervs.TimeRange, etc. etc.)
| <PlayButton className={`${styles.Button} ${styles.IconButton} ${styles.PlayButton}`}> | ||
| <PlayIcon className={styles.PlayIcon}></PlayIcon> | ||
| <PauseIcon className={styles.PauseIcon}></PauseIcon> | ||
| <PlayIcon className={`${styles.PlayIcon} ${styles.Icon}`} /> |
There was a problem hiding this comment.
Added Icon for reasons discussed in styles.ts comments.
| @@ -1,12 +1,14 @@ | |||
| export { CurrentTimeDisplay } from './components/media-current-time-display.js'; | |||
There was a problem hiding this comment.
Adding missing component and other relevant exports to main module for compiler efforts.
| export { MuteButton } from './components/MuteButton'; | ||
| export { PlayButton } from './components/PlayButton'; | ||
| export { Popover } from './components/Popover'; | ||
| export { TimeSlider } from './components/TimeSlider'; |
There was a problem hiding this comment.
Adding missing component and other relevant exports to main module for compiler efforts.
Some refactors to make skin compilation simpler and more reliable. Multiple callouts in self-added PR comments.