Skip to content

Commit 2b11b1b

Browse files
authored
Merge branch 'main' into datetime
2 parents 90960c2 + 87b76f2 commit 2b11b1b

File tree

24 files changed

+509
-55
lines changed

24 files changed

+509
-55
lines changed

.github/workflows/pr-review-companion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: PR review companion
77

88
on:
99
workflow_run:
10-
workflows: ["PR Test"]
10+
workflows: ["PR Test", "PR Test - new CI"]
1111
types:
1212
- completed
1313

.github/workflows/pr-test-new-ci.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# This file tests more or less everything related to a pull request. All
2+
# in one big job. At the end, if all the testing passes, it proceeds
3+
# to upload all the files that were built to our Dev environment.
4+
# This way, if the tests passed, you'll be able to review the built
5+
# pages on a public URL.
6+
7+
name: PR Test - new CI
8+
9+
on:
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
tests:
16+
if: github.repository == 'mdn/content' && startsWith(github.event.pull_request.title, '[new-ci]')
17+
runs-on: ubuntu-latest
18+
# Set the permissions to `read-all`, preventing the workflow from
19+
# any accidental write access to the repository.
20+
permissions: read-all
21+
env:
22+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
23+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
24+
# This is the directory where the built files will be placed.
25+
# It's also hardcoded in the `yarn build` command in package.json.
26+
# If you change it here, you must also make the same change in
27+
# package.json.
28+
BUILD_OUT_ROOT: build
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Get changed files
34+
run: |
35+
# Use the GitHub API to get the list of changed files
36+
# documentation: https://docs.github.com/rest/commits/commits#compare-two-commits
37+
DIFF_DOCUMENTS=$(gh api repos/{owner}/{repo}/compare/${BASE_SHA}...${HEAD_SHA} \
38+
--jq '.files | .[] | select(.status|IN("added", "modified", "renamed", "copied", "changed")) | .filename')
39+
40+
# filter out files that are not markdown files
41+
GIT_DIFF_CONTENT=$(echo "${DIFF_DOCUMENTS}" | egrep -i "^files/.*\.(md)$" | xargs)
42+
echo "GIT_DIFF_CONTENT=${GIT_DIFF_CONTENT}" >> $GITHUB_ENV
43+
44+
# filter out files that are not attachments
45+
GIT_DIFF_FILES=$(echo "${DIFF_DOCUMENTS}" | egrep -i "^files/.*\.(png|jpeg|jpg|gif|svg|webp)$" | xargs)
46+
echo "GIT_DIFF_FILES=${GIT_DIFF_FILES}" >> $GITHUB_ENV
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Setup Node.js environment
51+
if: ${{ env.GIT_DIFF_CONTENT }} || ${{ env.GIT_DIFF_FILES }}
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version-file: ".nvmrc"
55+
cache: yarn
56+
57+
- name: Install all yarn packages
58+
if: ${{ env.GIT_DIFF_CONTENT }} || ${{ env.GIT_DIFF_FILES }}
59+
run: yarn --frozen-lockfile
60+
env:
61+
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Build changed content
65+
id: build-content
66+
if: ${{ env.GIT_DIFF_CONTENT }}
67+
env:
68+
CONTENT_ROOT: ${{ github.workspace }}/files
69+
70+
# This is so that if there's a single 'unsafe_html' flaw, it
71+
# completely fails the build.
72+
# But all other flaws should be 'warn', so that we can include
73+
# information about the flaws when we analyze the built PR.
74+
BUILD_FLAW_LEVELS: "unsafe_html: error, *:warn"
75+
76+
# Because we build these pages in a way that you get a toolbar,
77+
# so the flaws can be displayed, but we don't want any of the
78+
# other toolbar features like "Fix fixable flaws" or "Quick-edit"
79+
# we set this to disable that stuff.
80+
REACT_APP_CRUD_MODE_READONLY: true
81+
82+
BUILD_LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev
83+
BUILD_LEGACY_LIVE_SAMPLES_BASE_URL: https://live-samples.mdn.allizom.net
84+
85+
# In these builds, we never care for or need the ability to sign in.
86+
# This environment variable will disable that functionality entirely.
87+
REACT_APP_DISABLE_AUTH: true
88+
89+
# TODO: This should be implicit when `CI=true`
90+
BUILD_NO_PROGRESSBAR: true
91+
92+
# Playground
93+
REACT_APP_PLAYGROUND_BASE_HOST: mdnyalp.dev
94+
95+
# rari
96+
LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev
97+
INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.allizom.net
98+
99+
run: |
100+
# The reason this script isn't in `package.json` is because
101+
# you don't need that script as a writer. It's only used in CI
102+
# and it can't use the default CONTENT_ROOT that gets set in
103+
# package.json.
104+
echo Y|yarn rari update
105+
ARGS=$(echo $GIT_DIFF_CONTENT | sed -E -e "s#(^| )files#\1-f $PWD/files#g")
106+
yarn rari build --no-basic --json-issues $ARGS
107+
yarn yari-render-html
108+
109+
echo "Disk usage size of the build"
110+
du -sh $BUILD_OUT_ROOT
111+
112+
# Save the PR number into the build
113+
echo ${{ github.event.number }} > ${BUILD_OUT_ROOT}/NR
114+
115+
# Download the raw diff blob and store that inside the build
116+
# directory.
117+
# The purpose of this is for the PR Review Companion to later
118+
# be able to use this raw diff file for the benefit of analyzing.
119+
wget https://github.com/${{ github.repository }}/compare/${BASE_SHA}...${HEAD_SHA}.diff -O ${BUILD_OUT_ROOT}/DIFF
120+
121+
- name: Merge static assets with built documents
122+
if: ${{ env.GIT_DIFF_CONTENT }}
123+
run: |
124+
# Exclude the .map files, as they're used for debugging JS and CSS.
125+
rsync -a --exclude "*.map" node_modules/@mdn/yari/client/build/ $BUILD_OUT_ROOT
126+
# Show the final disk usage size of the build.
127+
du -sh $BUILD_OUT_ROOT
128+
129+
- uses: actions/upload-artifact@v4
130+
if: ${{ env.GIT_DIFF_CONTENT }}
131+
with:
132+
name: build
133+
path: ${{ env.BUILD_OUT_ROOT }}
134+
135+
- name: Check changed files
136+
if: ${{ env.GIT_DIFF_FILES }}
137+
run: |
138+
echo $GIT_DIFF_FILES
139+
140+
export CONTENT_ROOT=$(pwd)/files
141+
yarn filecheck $GIT_DIFF_FILES

.github/workflows/pr-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
jobs:
1515
tests:
16-
if: github.repository == 'mdn/content'
16+
if: github.repository == 'mdn/content' && !startsWith(github.event.pull_request.title, '[new-ci]')
1717
runs-on: ubuntu-latest
1818
# Set the permissions to `read-all`, preventing the workflow from
1919
# any accidental write access to the repository.

files/en-us/glossary/aspect_ratio/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ page-type: glossary-definition
66

77
{{GlossarySidebar}}
88

9-
An **aspect ratio** is the proportional relationship between an element or {{glossary("viewport")}}'s width and height, and is represented as a ratio or two numbers.
9+
An **aspect ratio** is the proportional relationship between an element or {{glossary("viewport")}}'s width and height. It is represented as a {{cssxref("ratio")}} of two numbers.
1010

1111
Having an aspect ratio, whether it's an inherent aspect ratio like with images and videos or if it's extrinsically set, maintains the intended proportions of an element. You can also query an element or viewport's aspect, which is useful in developing flexible components and layouts.
1212

files/en-us/web/api/dommatrixreadonly/flipx/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ browser-compat: api.DOMMatrixReadOnly.flipX
88

99
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}
1010

11-
The `flipX()` method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the original matrix flipped about the x-axis.
11+
The **`flipX()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the original matrix flipped about the x-axis. This is equivalent to multiplying the matrix by `DOMMatrix(-1, 0, 0, 1, 0, 0)`. The original matrix is not modified.
1212

1313
## Syntax
1414

@@ -18,16 +18,14 @@ The `flipX()` method of the {{domxref("DOMMatrixReadOnly")}} interface creates a
1818

1919
### Return value
2020

21-
Returns a [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix) containing a new matrix being the result of the original matrix flipped about the x-axis, which is equivalent to multiplying the matrix by `DOMMatrix(-1, 0, 0, 1, 0, 0)`. The original matrix is not modified.
21+
Returns a [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix).
2222

2323
## Examples
2424

2525
### Inverting a triangle
2626

2727
In this example, the SVG contains two paths in the shape of a triangle, both drawn to the same position. Note that the x co-ordinate of the viewBox attribute is negative, showing us content from both sides of the x-axis.
2828

29-
The JavaScript first creates an identity matrix, then uses the `flipX()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis. The red triangle is left in place.
30-
3129
#### HTML
3230

3331
```html
@@ -39,6 +37,8 @@ The JavaScript first creates an identity matrix, then uses the `flipX()` method
3937

4038
#### JavaScript
4139

40+
The JavaScript first creates an identity matrix, then uses the `flipX()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis. The red triangle is left in place.
41+
4242
```js
4343
const flipped = document.getElementById("flipped");
4444
const matrix = new DOMMatrixReadOnly();
@@ -57,3 +57,7 @@ flipped.setAttribute("transform", flippedMatrix.toString());
5757
## Browser compatibility
5858

5959
{{Compat}}
60+
61+
## See also
62+
63+
- {{domxref("DOMMatrixReadOnly.flipY()")}}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: "DOMMatrixReadOnly: flipY() method"
3+
short-title: flipY()
4+
slug: Web/API/DOMMatrixReadOnly/flipY
5+
page-type: web-api-instance-method
6+
browser-compat: api.DOMMatrixReadOnly.flipY
7+
---
8+
9+
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}
10+
11+
The **`flipY()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the original matrix flipped about the y-axis. This is equivalent to multiplying the matrix by `DOMMatrix(1, 0, 0, -1, 0, 0)`. The original matrix is not modified.
12+
13+
## Syntax
14+
15+
```js-nolint
16+
DOMMatrixReadOnly.flipY()
17+
```
18+
19+
### Return value
20+
21+
A [`DOMMatrix`](/en-US/docs/Web/API/DOMMatrix).
22+
23+
## Examples
24+
25+
### Inverting a triangle
26+
27+
In this example, the SVG contains two identical [paths](/en-US/docs/Web/SVG/Attribute/d) in the shape of a triangle; they are both drawn to have the same size and position. The viewbox has a negative y value showing us content from both sides of the y-axis. This enables the flipped triangle to be withing the viewport after it is transformed.
28+
29+
#### HTML
30+
31+
```html
32+
<svg height="200" width="100" viewBox="0 -100 100 200">
33+
<path fill="red" d="M 0 0 L 100 0 L 50 100 Z" />
34+
<path fill="blue" d="M 0 0 L 100 0 L 50 100 Z" id="flipped" />
35+
</svg>
36+
```
37+
38+
#### JavaScript
39+
40+
The JavaScript creates an [identity matrix](/en-US/docs/Web/API/DOMMatrixReadOnly/isIdentity), then uses the `flipY()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the y-axis. The red triangle is left in place.
41+
42+
```js
43+
const flipped = document.getElementById("flipped");
44+
const matrix = new DOMMatrix();
45+
const flippedMatrix = matrix.flipY();
46+
flipped.setAttribute("transform", flippedMatrix.toString());
47+
```
48+
49+
#### Result
50+
51+
{{EmbedLiveSample('Inverting a triangle', '', '240')}}
52+
53+
## Specifications
54+
55+
{{Specifications}}
56+
57+
## Browser compatibility
58+
59+
{{Compat}}
60+
61+
## See also
62+
63+
- {{domxref("DOMMatrixReadOnly.flipX()")}}

files/en-us/web/api/popstateevent/hasuavisualtransition/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ title: "PopStateEvent: hasUAVisualTransition property"
33
short-title: hasUAVisualTransition
44
slug: Web/API/PopStateEvent/hasUAVisualTransition
55
page-type: web-api-instance-property
6-
status:
7-
- experimental
86
browser-compat: api.PopStateEvent.hasUAVisualTransition
97
---
108

11-
{{APIRef("History API")}}{{SeeCompatTable}}
9+
{{APIRef("History API")}}
1210

1311
The **`hasUAVisualTransition`** read-only property of the {{domxref("PopStateEvent")}} interface returns `true` if the user agent performed a visual transition for this navigation before dispatching this event, or `false` otherwise.
1412

files/en-us/web/api/popstateevent/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _This interface also inherits the properties of its parent, {{domxref("Event")}}
2828

2929
- {{domxref("PopStateEvent.state")}} {{ReadOnlyInline}}
3030
- : Returns a copy of the information that was provided to `pushState()` or `replaceState()`.
31-
- {{domxref("PopStateEvent.hasUAVisualTransition", "hasUAVisualTransition")}} {{ReadOnlyInline}} {{Experimental_Inline}}
31+
- {{domxref("PopStateEvent.hasUAVisualTransition", "hasUAVisualTransition")}} {{ReadOnlyInline}}
3232
- : Returns `true` if the user agent performed a visual transition for this navigation before dispatching this event, or `false` otherwise.
3333

3434
## Instance methods

0 commit comments

Comments
 (0)