Skip to content

Commit

Permalink
Merge branch 'main' into fix-translate-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Feb 7, 2024
2 parents 50c3a3f + a3f7c33 commit edb3507
Show file tree
Hide file tree
Showing 99 changed files with 12,870 additions and 7,859 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A clear and concise description of what the bug is.

**To Reproduce**

If possible, please provide a CodeSandbox/Codepen that demonstrates the issue. You can use the following template: https://codesandbox.io/s/preact-x-preact-cli-3-starter-vj285y2rn3
If possible, please provide a link to a StackBlitz/CodeSandbox/Codepen project or a GitHub repository that demonstrates the issue. You can use the following template on StackBlitz to get started: https://stackblitz.com/edit/create-preact-starter

Steps to reproduce the behavior:

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'src/**.js'
push:
branches:
- master
- main
- restructure
paths:
- 'src/**.js'
Expand All @@ -36,17 +36,17 @@ jobs:
name: bench-environment
path: preact-local.tgz
- name: Download base package
uses: andrewiggins/download-base-artifact@v2
uses: andrewiggins/download-base-artifact@v3
with:
artifact: npm-package
workflow: ci.yml
required: false
- run: mv preact.tgz preact-master.tgz
- run: mv preact.tgz preact-main.tgz
- name: Upload base preact package
uses: actions/upload-artifact@v3
with:
name: bench-environment
path: preact-master.tgz
path: preact-main.tgz

bench_todo:
name: Bench todo
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,34 @@ name: CI
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
description: 'Branch or tag ref to check out'
type: string
required: false
default: ''
artifact_name:
description: 'Name of the artifact to upload'
type: string
required: false
default: 'npm-package'
pull_request:
branches:
- '**'
push:
branches:
- master
- main
- restructure

jobs:
build_test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || '' }}
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
Expand All @@ -34,6 +47,7 @@ jobs:
npm run test:unit
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
timeout-minutes: 2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Package
Expand All @@ -44,5 +58,5 @@ jobs:
- name: Upload npm package
uses: actions/upload-artifact@v3
with:
name: npm-package
name: ${{ inputs.artifact_name || 'npm-package' }}
path: preact.tgz
2 changes: 1 addition & 1 deletion .github/workflows/pr-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
uses: andrewiggins/tachometer-reporter-action@v2
with:
path: results/*.json
base-bench-name: preact-master
base-bench-name: preact-main
pr-bench-name: preact-local
summarize: 'duration, usedJSHeapSize'
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on: create
jobs:
build:
if: github.ref_type == 'tag'
uses: preactjs/preact/.github/workflows/ci.yml@master
uses: preactjs/preact/.github/workflows/ci.yml@main

release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: npm-package
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Benchmark
name: Benchmark Worker

# Expectations:
#
Expand Down Expand Up @@ -31,8 +31,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
Expand All @@ -53,6 +53,9 @@ jobs:
with:
name: results
path: benches/results/${{ inputs.benchmark }}.json
- name: Anaylze logs if present
working-directory: benches
run: '[ -d logs ] && npm run analyze ${{ inputs.benchmark }} || echo "No logs to analyze"'
- name: Tar logs if present
working-directory: benches
run: '[ -d logs ] && tar -zcvf ${{ inputs.benchmark}}_logs.tgz logs || echo "No logs found"'
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/saucelabs.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
name: Saucelabs

on:
workflow_dispatch:
push:
branches:
- master
- main
- restructure

jobs:
build_test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- name: test
timeout-minutes: 20
env:
CI: true
COVERAGE: true
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/single-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Benchmark Debug

on:
workflow_dispatch:
inputs:
benchmark:
description: 'Which benchmark to run'
type: choice
options:
- 02_replace1k
- 03_update10th1k_x16
- 07_create10k
- filter_list
- hydrate1k
- many_updates
- text_update
- todo
required: true
base:
description: 'The branch name, tag, or commit sha of the version of preact to benchmark against.'
type: string
default: main
required: false
trace:
description: 'Whether to capture browser traces for this benchmark run'
type: boolean
default: true
required: false
# A bug in GitHub actions prevents us from passing numbers (as either
# number or string type) to called workflows. So disabling this for now.
# See: https://github.com/orgs/community/discussions/67182
#
# timeout:
# description: 'How many minutes to give the benchmark to run before timing out and failing'
# type: number
# default: 20
# required: false

jobs:
build_local:
name: Build local package
uses: ./.github/workflows/ci.yml

build_base:
name: Build base package
uses: ./.github/workflows/ci.yml
with:
ref: ${{ inputs.base }}
artifact_name: base-npm-package

prepare:
name: Prepare environment
runs-on: ubuntu-latest
needs:
- build_local
- build_base
timeout-minutes: 5
steps:
- name: Download locally built preact package
uses: actions/download-artifact@v3
with:
name: npm-package
- run: mv preact.tgz preact-local.tgz
- name: Upload locally built preact package
uses: actions/upload-artifact@v3
with:
name: bench-environment
path: preact-local.tgz
- name: Clear working directory
run: |
ls -al
rm -rf *
echo "===================="
ls -al
- name: Download base package
uses: actions/download-artifact@v3
with:
name: base-npm-package
- run: mv preact.tgz preact-main.tgz
- name: Upload base preact package
uses: actions/upload-artifact@v3
with:
name: bench-environment
path: preact-main.tgz

benchmark:
name: Bench ${{ inputs.benchmark }}
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: ${{ inputs.benchmark }}
trace: ${{ inputs.trace }}
# timeout: ${{ inputs.timeout }}
4 changes: 2 additions & 2 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ Unique to Preact we do support several ways to hook into our renderer. All our a

## Important Branches

We merge every PR into the `master` branch which is the one that we'll use to publish code to npm. For the previous Preact release line we have a branch called `8` which is in maintenance mode. As a new contributor you won't have to deal with that ;)
We merge every PR into the `main` branch which is the one that we'll use to publish code to npm. For the previous Preact release line we have a branch called `8` which is in maintenance mode. As a new contributor you won't have to deal with that ;)

## Creating your first Pull-Request

We try to make it as easy as possible to contribute to Preact and make heavy use of GitHub's "Draft PR" feature which tags Pull-Requests (short = PR) as work in progress. PRs tend to be published as soon as there is an idea that the developer deems worthwhile to include into Preact and has written some rough code. The PR doesn't have to be perfect or anything really ;)

Once a PR or a Draft PR has been created our community typically joins the discussion about the proposed change. Sometimes that includes ideas for test cases or even different ways to go about implementing a feature. Often this also includes ideas on how to make the code smaller. We usually refer to the latter as "code-golfing" or just "golfing".

When everything is good to go someone will approve the PR and the changes will be merged into the `master` branch and we usually cut a release a few days/ a week later.
When everything is good to go someone will approve the PR and the changes will be merged into the `main` branch and we usually cut a release a few days/ a week later.

_The big takeaway for you here is, that we will guide you along the way. We're here to help to make a PR ready for approval!_

The short summary is:

1. Make changes and submit a PR
2. Modify change according to feedback (if there is any)
3. PR will be merged into `master`
3. PR will be merged into `main`
4. A new release will be cut (every 2-3 weeks).

## Commonly used scripts for contributions
Expand Down Expand Up @@ -172,7 +172,7 @@ rights to publish new releases on npm.

1. Make a PR where **only** the version number is incremented in `package.json` and everywhere else. A simple search and replace works. (note: We follow `SemVer` conventions)
2. Wait until the PR is approved and merged.
3. Switch back to the `master` branch and pull the merged PR
3. Switch back to the `main` branch and pull the merged PR
4. Create and push a tag for the new version you want to publish:
1. `git tag 10.0.0`
2. `git push --tags`
Expand All @@ -195,7 +195,7 @@ rights to publish new releases on npm.
1. I'd recommend writing them in an offline editor because each edit to a draft will change the URL in GitHub.
2. Make a PR where **only** the version number is incremented in `package.json` (note: We follow `SemVer` conventions)
3. Wait until the PR is approved and merged.
4. Switch back to the `master` branch and pull the merged PR
4. Switch back to the `main` branch and pull the merged PR
5. Run `npm run build && npm publish`
1. Make sure you have 2FA enabled in npm, otherwise the above command will fail.
2. If you're doing a pre-release add `--tag next` to the `npm publish` command to publish it under a different tag (default is `latest`)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[![OpenCollective Backers](https://opencollective.com/preact/backers/badge.svg)](#backers)
[![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors)

[![coveralls](https://img.shields.io/coveralls/preactjs/preact/master.svg)](https://coveralls.io/github/preactjs/preact)
[![coveralls](https://img.shields.io/coveralls/preactjs/preact/main.svg)](https://coveralls.io/github/preactjs/preact)
[![gzip size](http://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=gzip&label=gzip)](https://unpkg.com/preact/dist/preact.min.js)
[![brotli size](http://img.badgesize.io/https://unpkg.com/preact/dist/preact.min.js?compression=brotli&label=brotli)](https://unpkg.com/preact/dist/preact.min.js)

Expand Down Expand Up @@ -185,6 +185,6 @@ MIT
[![Preact](https://i.imgur.com/YqCHvEW.gif)](https://preactjs.com)
[preact/compat]: https://github.com/preactjs/preact/tree/master/compat
[preact/compat]: https://github.com/preactjs/preact/tree/main/compat
[hyperscript]: https://github.com/dominictarr/hyperscript
[DevTools]: https://github.com/preactjs/preact-devtools
3 changes: 2 additions & 1 deletion benches/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es2020",
"target": "es2022",
"module": "es2022",
"checkJs": true,
"moduleResolution": "node"
},
Expand Down
Loading

0 comments on commit edb3507

Please sign in to comment.