Skip to content

Commit fcbc142

Browse files
authored
fix(nx-dev): improve bandwidth usage convert gif to mp4 (nrwl#27129)
This PR aims to improve the bandwidth usage of nx-dev which is hosted on Vercel.
1 parent 09c0b3d commit fcbc142

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

docs/blog/2024-05-08-nx-19-release.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Notice how all tasks are now appropriately grouped in the `E2E (CI)` group!
8282

8383
You can also find the same enhancements in Nx Cloud. Below is a view of all tasks in the [CI pipeline](https://staging.nx.app/runs/ctbAZfiLy3):
8484

85-
[![Grouped e2e tests in Nx Cloud](/blog/images/2024-05-08/nx-cloud-atomizer-groupings.gif)](https://staging.nx.app/runs/ctbAZfiLy3)
85+
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
8686

8787
Notice how all e2e groups are collapsed by default to give a concise view, while allowing you to expand to see how each individual task is progressing!
8888

@@ -160,7 +160,7 @@ Since Nx 18 release, we also started using Project Crystal inside of the Nx repo
160160

161161
You can find a full list of fixes and features applied in this major release [here](https://github.com/nrwl/nx/releases/tag/19.0.0).
162162

163-
[![Changelog for Nx 19](/blog/images/2024-05-08/fixes.gif)](https://github.com/nrwl/nx/releases/tag/19.0.0)
163+
{% video-player src="/documentation/blog/media/2024-05-08/fixes.mp4" alt="A display listing the Github changelog" /%}
164164

165165
With Project Crystal landed now, we're also adjusting our priorities to place a higher importance on stability. You should see this reflected in Nx 19.
166166

@@ -182,7 +182,7 @@ In February, we launched two big enhancements to Nx Cloud: the [Atomizer](/ci/fe
182182

183183
Since then, the Atomizer has received a nice UI update (as we had seen earlier):
184184

185-
[![Grouped e2e tests in Nx Cloud](/blog/images/2024-05-08/nx-cloud-atomizer-groupings.gif)](https://staging.nx.app/runs/ctbAZfiLy3)
185+
{% video-player src="/documentation/blog/media/2024-05-08/nx-cloud-atomizer-groupings.mp4" alt="Showing the Atomizer in Nx Cloud" link="https://staging.nx.app/runs/ctbAZfiLy3" /%}
186186

187187
Since February, we also revamped our task distribution algorithms. This has resulted in a 5-20% (depending on the repo) increase in both speed and cost efficiency for our users.
188188

docs/blog/images/2024-05-08/fixes.gif

-35 MB
Binary file not shown.
Binary file not shown.

docs/blog/media/2024-05-08/fixes.mp4

2.87 MB
Binary file not shown.
Binary file not shown.

nx-dev/ui-markdoc/src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import { Pill } from './lib/tags/pill.component';
5757
import { pill } from './lib/tags/pill.schema';
5858
import { fence } from './lib/nodes/fence.schema';
5959
import { FenceWrapper } from './lib/nodes/fence-wrapper.component';
60+
import { VideoPlayer, videoPlayer } from './lib/tags/video-player.component';
6061

6162
// TODO fix this export
6263
export { GithubRepository } from './lib/tags/github-repository.component';
@@ -83,6 +84,7 @@ export const getMarkdocCustomConfig = (
8384
graph,
8485
iframe,
8586
'install-nx-console': installNxConsole,
87+
'video-player': videoPlayer,
8688
persona,
8789
personas,
8890
'project-details': projectDetails,
@@ -127,6 +129,7 @@ export const getMarkdocCustomConfig = (
127129
Tweet,
128130
YouTube,
129131
VideoLink,
132+
VideoPlayer,
130133
// SvgAnimation,
131134
},
132135
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { VideoLoop } from './video-loop.component';
2+
import { Schema } from '@markdoc/markdoc';
3+
4+
export const videoPlayer: Schema = {
5+
render: 'VideoPlayer',
6+
attributes: {
7+
src: {
8+
type: 'String',
9+
required: true,
10+
},
11+
alt: {
12+
type: 'String',
13+
required: false,
14+
},
15+
link: {
16+
type: 'String',
17+
required: false,
18+
},
19+
},
20+
};
21+
22+
export function VideoPlayer({
23+
src,
24+
alt,
25+
link,
26+
}: {
27+
src: string;
28+
alt: string;
29+
link: string;
30+
}): JSX.Element {
31+
return (
32+
<div className="overflow-x-auto">
33+
{link ? (
34+
<a href={link} target="_blank" rel="noreferrer">
35+
<VideoLoop src={src} alt={alt}></VideoLoop>
36+
</a>
37+
) : (
38+
<VideoLoop src={src} alt={alt}></VideoLoop>
39+
)}
40+
</div>
41+
);
42+
}

0 commit comments

Comments
 (0)