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

Make our launch_static_server script runnable as a script #1654

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Feb 28, 2025

I wanted today to run an HTTPS server serving local files quickly to test something only locally.

What I did normally was to rely on the http-server npm package, which may be the better way, but I always forget the syntax wanted to provide my TLS certificate and key files (my self-signed ones for localhost).

We also have a much simpler launch_static_server.mjs script which does that, and which has the main advantage that we're more used to it, as we use it to run tests, our demo locally and so on.

But that file was only exported as an ES6 module and not as a script. Consequently it only worked if imported and ran from another JS file, but not by running it directly through node.js.

Moreover, I know that @Florent-Bouisset had the same need two days ago.

So I thought it could in the end also run as a script. The main ""difficulty"" is here to process flags but we already do that in a variety of other scripts, so it was quick to add.

I could do my tests.... under I'll admit a little more time than if I just did a npx http-server --help, but where's the fun in that?

@peaBerberian peaBerberian force-pushed the misc/script-static-server branch 3 times, most recently from 408387d to 56dec10 Compare February 28, 2025 16:48
Copy link

Automated performance checks have been performed on commit 56dec108ef15e8c115606d40e79df34a87c01b2b with the base branch dev.

Tests results

✅ Tests have passed.

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 20.84ms -> 20.92ms (-0.081ms, z: 0.78295) 28.65ms -> 28.50ms
seeking 16.98ms -> 17.60ms (-0.617ms, z: 0.03427) 11.40ms -> 11.55ms
audio-track-reload 27.54ms -> 27.40ms (0.139ms, z: 0.78473) 39.90ms -> 39.75ms
cold loading multithread 50.73ms -> 49.27ms (1.457ms, z: 10.71785) 73.05ms -> 71.85ms
seeking multithread 22.07ms -> 18.15ms (3.922ms, z: 0.49886) 10.50ms -> 10.50ms
audio-track-reload multithread 27.33ms -> 27.33ms (0.005ms, z: 0.39606) 39.90ms -> 39.90ms
hot loading multithread 17.71ms -> 17.64ms (0.069ms, z: 2.35633) 25.65ms -> 25.35ms

If you want to skip performance checks for latter commits, add the skip-performance-checks label to this Pull Request.

@peaBerberian peaBerberian force-pushed the misc/script-static-server branch from 56dec10 to d1b7087 Compare March 3, 2025 10:54
Copy link

github-actions bot commented Mar 3, 2025

Automated performance checks have been performed on commit d1b70874d37b9301f98d463fe6d023abb50e06a6 with the base branch dev.

Tests results

✅ Tests have passed.

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.85ms -> 19.77ms (0.079ms, z: 0.81839) 27.30ms -> 27.30ms
seeking 12.06ms -> 14.04ms (-1.977ms, z: 1.36499) 11.40ms -> 11.40ms
audio-track-reload 26.89ms -> 26.85ms (0.041ms, z: 0.21131) 39.15ms -> 39.15ms
cold loading multithread 48.67ms -> 47.84ms (0.833ms, z: 10.53607) 71.25ms -> 70.05ms
seeking multithread 19.31ms -> 16.69ms (2.617ms, z: 0.91269) 10.50ms -> 10.50ms
audio-track-reload multithread 26.62ms -> 26.43ms (0.194ms, z: 2.18043) 39.15ms -> 39.00ms
hot loading multithread 16.75ms -> 16.77ms (-0.020ms, z: 1.18513) 24.45ms -> 24.30ms

If you want to skip performance checks for latter commits, add the skip-performance-checks label to this Pull Request.

I wanted today to run an HTTPS server serving local files quickly to
test something only locally.

What I do normally was to rely on rely on the `http-server` npm package,
which may be the better way, but I always forget the syntax wanted to
provide my certificate and key file (my self-signed ones for localhost).

We also have a much simpler `launch_static_server.mjs` script which does
that, and which has the main advantage that we're more used to it, as we
use it to run tests, our demo locally and so on.

But that file was only exported as an ES6 module and not as a script.
Consequently it only worked if imported and ran from another JS file,
but not by running directly through node.js.

Moreover, I know that @FlorentBouisset had the same need two days ago.

So I thought it could in the end also run as a script. The main
""difficulty"" is here to process flags but we already do that in a
variety of other scripts, so it was quick to add.

I could do my tests.... under I'll admit a little more time than if I
just did a `npx http-server --help`, but where's the fun in that?
@peaBerberian peaBerberian force-pushed the misc/script-static-server branch from d1b7087 to ad37243 Compare March 3, 2025 11:59
Copy link

github-actions bot commented Mar 3, 2025

Automated performance checks have been performed on commit ad372433aa08855f3a77d0c17ca5c3e7cd0a6229 with the base branch dev.

Tests results

✅ Tests have passed.

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 20.33ms -> 20.57ms (-0.240ms, z: 0.68956) 28.05ms -> 28.05ms
seeking 13.52ms -> 18.26ms (-4.739ms, z: 1.07129) 11.55ms -> 11.40ms
audio-track-reload 27.14ms -> 27.36ms (-0.221ms, z: 0.38609) 39.60ms -> 39.60ms
cold loading multithread 49.53ms -> 48.74ms (0.790ms, z: 8.35999) 72.30ms -> 71.10ms
seeking multithread 14.11ms -> 24.02ms (-9.910ms, z: 0.76801) 10.50ms -> 10.50ms
audio-track-reload multithread 27.09ms -> 26.98ms (0.109ms, z: 1.51098) 39.80ms -> 39.60ms
hot loading multithread 17.14ms -> 17.08ms (0.057ms, z: 2.40116) 25.05ms -> 24.75ms

If you want to skip performance checks for latter commits, add the skip-performance-checks label to this Pull Request.

@peaBerberian peaBerberian merged commit 8ffffb8 into dev Mar 4, 2025
10 checks passed
@peaBerberian peaBerberian added this to the 4.3.0 milestone Mar 4, 2025
@peaBerberian peaBerberian added the script Relative to the RxPlayer's scripts (e.g. build scripts, release scripts etc.) label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
script Relative to the RxPlayer's scripts (e.g. build scripts, release scripts etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants