Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: talentedandrew/preact
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: preactjs/preact
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 323 changed files with 54,951 additions and 21,685 deletions.
23 changes: 0 additions & 23 deletions .babelrc

This file was deleted.

8 changes: 1 addition & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -7,15 +7,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,.*rc,*.yml}]
[{*.json,.*rc,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

# Uglify (or some other tool) always rewrites this file
# without a final newline on build, so disabling that
# editorconfig feature specifically for this file
[mangle.json,**/mangle.json]
insert_final_newline = false
5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
test/fixtures
test/ts/
*.ts
dist
benchmarks
10 changes: 0 additions & 10 deletions .flowconfig

This file was deleted.

46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@preactjs.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
8 changes: 1 addition & 7 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
github: [preactjs]
open_collective: preact
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---

- [ ] Check if updating to the latest Preact version resolves the issue

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

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:

1. Go to '...'
2. Click on '....'
3. See error

**Expected behavior**
What should have happened when following the steps above?
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''
---

**Describe the feature you'd love to see**
A clear and concise description of what you'd love to see added to Preact.

**Additional context (optional)**
Add any other context or screenshots about the feature request here.
91 changes: 91 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Benchmarks

on:
workflow_dispatch:
workflow_call:

jobs:
prepare:
name: Prepare environment
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Download locally built preact package
uses: actions/download-artifact@v4
with:
name: npm-package
- run: mv preact.tgz preact-local.tgz
- name: Download base package
uses: andrewiggins/download-base-artifact@v3
with:
artifact: npm-package
workflow: ci.yml
required: true
- run: mv preact.tgz preact-main.tgz
- name: Upload locally build & base preact package
uses: actions/upload-artifact@v4
with:
name: bench-environment
path: |
preact-local.tgz
preact-main.tgz
bench_todo:
name: Bench todo
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: todo/todo
timeout: 10

bench_text_update:
name: Bench text-update
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: text-update/text-update
timeout: 10

bench_many_updates:
name: Bench many-updates
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: many-updates/many-updates
timeout: 10

bench_replace1k:
name: Bench replace1k
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: table-app/replace1k

bench_update10th1k:
name: Bench 03_update10th1k_x16
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: table-app/update10th1k

bench_create10k:
name: Bench create10k
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: table-app/create10k

bench_hydrate1k:
name: Bench hydrate1k
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: table-app/hydrate1k

bench_filter_list:
name: Bench filter-list
uses: ./.github/workflows/run-bench.yml
needs: prepare
with:
benchmark: filter-list/filter-list
timeout: 10
56 changes: 56 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build & Test

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'

jobs:
build_test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || '' }}
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- name: test
env:
CI: true
COVERAGE: true
FLAKEY: false
# Not using `npm test` since it rebuilds source which npm ci has already done
run: |
npm run lint
npm run test:unit
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.3.0
timeout-minutes: 2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-error: false
- name: Package
# Use --ignore-scripts here to avoid re-building again before pack
run: |
npm pack --ignore-scripts
mv preact-*.tgz preact.tgz
- name: Upload npm package
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name || 'npm-package' }}
path: preact.tgz
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches:
- '**'
push:
branches:
- main
- restructure
- v11

jobs:
filter_jobs:
name: Filter jobs
runs-on: ubuntu-latest
outputs:
jsChanged: ${{ steps.filter.outputs.jsChanged }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
# Should be kept in sync with the filter in the PR Reporter workflow
predicate-quantifier: 'every'
filters: |
jsChanged:
- '**/src/**/*.js'
- '!devtools/src/devtools.js'
compressed_size:
name: Compressed Size
needs: filter_jobs
if: ${{ needs.filter_jobs.outputs.jsChanged == 'true' }}
uses: ./.github/workflows/size.yml

build_test:
name: Build & Test
needs: filter_jobs
uses: ./.github/workflows/build-test.yml

benchmarks:
name: Benchmarks
needs: build_test
if: ${{ needs.filter_jobs.outputs.jsChanged == 'true' }}
uses: ./.github/workflows/benchmarks.yml
Loading