diff --git a/.changeset/config.json b/.changeset/config.json
index 5980f269..68528c0e 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -1,11 +1,11 @@
{
- "$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
- "changelog": ["@changesets/changelog-github", { "repo": "wbkd/react-flow" }],
+ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
+ "changelog": ["@changesets/changelog-github", { "repo": "xyflow/xyflow" }],
"commit": false,
"fixed": [],
"linked": [],
- "access": "public",
+ "access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
- "ignore": []
+ "ignore": ["react-examples", "svelte-examples", "astro-examples", "playwright"]
}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 842f28e8..2d4ff726 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -4,47 +4,57 @@ body:
- type: markdown
attributes:
value: |
- Thank you for reporting an issue :pray:.
+ Hello! :sparkles: You found the place to submit a bug or issue that you discovered in the xyflow library, thank you for helping us out!
- **Please only file issues for v11. Will will no longer fix issues for v10.**
+ Having trouble making something work in xyflow, but it’s not a bug with the library itself? You’ll get the fastest response by asking in [github discussions](https://github.com/xyflow/xyflow/discussions) or our [discord server](https://discord.gg/RVmnytFmGW).
- This issue tracker is for reporting bugs found in react-flow (https://github.com/wbkd/react-flow)
- If you have a question about how to achieve something and are struggling, please post a question
- inside of react-flow's Discussion's tab: https://github.com/wbkd/react-flow/discussions
- If it's an issue about the docs please go to the react-flow-docs (https://github.com/wbkd/react-flow-docs)
+ **Search our [discussions](https://github.com/xyflow/xyflow/discussions?discussions_q=) and [issues](https://github.com/xyflow/xyflow/issues?q=)** to see if your problem has already been reported and you can add more context, or see if someone else has already solved your issue. And of course, check our [docs](https://reactflow.dev/learn) if you haven’t already.
- Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
- - react-flow's Open Issue's tab: https://github.com/wbkd/react-flow/issues?q=is%3Aissue+sort%3Aupdated-desc+position
- - react-flow's Closed Issues tab: https://github.com/wbkd/react-flow/issues?q=is%3Aissue+sort%3Aupdated-desc+position+is%3Aclosed
- - react-flow's Discussion's tab: https://github.com/wbkd/react-flow/discussions
+ **Issue with the xyflow Docs?** Submit an issue in our [web repo](https://github.com/xyflow/web/issues) instead.
- The more information you fill in, the better the community can help you.
+ With that out of the way, let’s get started :bug:
- type: textarea
- id: description
+ id: platform
attributes:
- label: Describe the Bug
- description: Provide a clear and concise description of the challenge you are running into.
+ label: What platform were you using when you found the bug?
+ description: We only address issues for the most recent xyflow major release or upcoming releases.
+ value: |
+ - React Flow / Svelte Flow version:
+ - Browser and version:
+ - OS and version:
validations:
required: true
- type: input
id: link
attributes:
- label: Your Example Website or App
+ label: Live code example
description: |
- Which website or app were you using when the bug happened?
- Note:
- - Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `react-flow-renderer` npm package.
- - To create a shareable code example you can use Codesandbox (https://codesandbox.io/s/react-flow-starter-ou8or) or Stackblitz (https://stackblitz.com/).
- - Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
- placeholder: |
- e.g. https://stackblitz.com/edit/...... OR Github Repo
+ This is the most important part of the bug report!
+
+ React Flow codesandbox starters
+ - js: https://new.reactflow.dev/js
+ - ts: https://new.reactflow.dev/ts
+
+ Svelte Flow stackblitz starters
+ - js: https://new.svelteflow.dev/js
+ - ts: https://new.svelteflow.dev/ts
+
+ Avoid dependencies in your example for easier debugging.
+ placeholder: https://stackblitz.com/edit/... or Github Repo
validations:
required: false
+ - type: textarea
+ id: description
+ attributes:
+ label: Describe the Bug
+ description: What exactly is happening when you encounter the bug?
+ validations:
+ required: true
- type: textarea
id: steps
attributes:
- label: Steps to Reproduce the Bug or Issue
- description: Describe the steps we have to take to reproduce the behavior.
+ label: Steps to reproduce the bug or issue
+ description: How can we see the reported behavior in the code example you provided? The more detail, the better!
placeholder: |
1. Go to '...'
2. Click on '....'
@@ -56,9 +66,8 @@ body:
id: expected
attributes:
label: Expected behavior
- description: Provide a clear and concise description of what you expected to happen.
- placeholder: |
- As a user, I expected ___ behavior but i am seeing ___
+ description: What would you expect to happen if there was no bug or issue?
+ placeholder: As a user, I expected ___ behavior, but instead I am seeing ___
validations:
required: true
- type: textarea
@@ -67,22 +76,9 @@ body:
label: Screenshots or Videos
description: |
If applicable, add screenshots or a video to help explain your problem.
- For more information on the supported file image/file types and the file size limits, please refer
- to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
- placeholder: |
- You can drag your video or image files inside of this editor ↓
- - type: textarea
- id: platform
- attributes:
- label: Platform
- value: |
- - OS: [e.g. macOS, Windows, Linux]
- - Browser: [e.g. Chrome, Safari, Firefox]
- - Version: [e.g. 91.1]
- validations:
- required: true
+ Supported image/file types and file size limits- https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files
+ placeholder: Drag your video or image files inside of this editor
- type: textarea
id: additional
attributes:
label: Additional context
- description: Add any other context about the problem here.
diff --git a/.github/actions/ci-checks/action.yml b/.github/actions/ci-checks/action.yml
new file mode 100644
index 00000000..d4a87a86
--- /dev/null
+++ b/.github/actions/ci-checks/action.yml
@@ -0,0 +1,11 @@
+name: 'CI checks'
+
+runs:
+ using: 'composite'
+ steps:
+ - name: Build
+ run: pnpm build
+ shell: bash
+ - name: Typecheck
+ run: pnpm typecheck
+ shell: bash
diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml
new file mode 100644
index 00000000..5ac07699
--- /dev/null
+++ b/.github/actions/ci-setup/action.yml
@@ -0,0 +1,14 @@
+name: 'CI setup'
+
+runs:
+ using: 'composite'
+ steps:
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ - name: Setup node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20.x
+ - name: Install dependencies
+ run: pnpm install
+ shell: bash
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
new file mode 100644
index 00000000..2e94ce0e
--- /dev/null
+++ b/.github/workflows/playwright.yml
@@ -0,0 +1,25 @@
+name: Playwright Tests
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ playwright:
+ name: 'Playwright Tests'
+ runs-on: ubuntu-latest
+ container:
+ image: mcr.microsoft.com/playwright:v1.45.0-jammy
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v4
+ - uses: ./.github/actions/ci-setup
+ - uses: ./.github/actions/ci-checks
+ - name: Run your tests
+ run: CI=true pnpm test:react
+ env:
+ HOME: /root
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..1ce9d920
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,30 @@
+name: Release
+
+on:
+ workflow_dispatch:
+# push:
+# branches:
+# - main
+
+concurrency: ${{ github.workflow }}-${{ github.ref }}
+
+jobs:
+ release:
+ name: Release
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v4
+ - uses: ./.github/actions/ci-setup
+ - uses: ./.github/actions/ci-checks
+
+ - name: Create release PR or publish to npm
+ id: changesets
+ uses: xyflow/changeset-action@v1
+ with:
+ publish: pnpm release
+ title: Release packages
+ commit: 'chore(packages): bump'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.npmrc b/.npmrc
index 8d10578a..acb88cc7 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1,3 +1,2 @@
-registry="https://registry.npmjs.com/"
legacy-peer-deps=true
strict-peer-dependencies=false
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index a8e03fd7..8540abfb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019-2023 webkid GmbH
+Copyright (c) 2019-2024 webkid GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 722fa001..b398b065 100644
--- a/README.md
+++ b/README.md
@@ -17,22 +17,22 @@ Powerful open source libraries for building node-based UIs with React or Svelte.
## The xyflow mono repo
The xyflow repository is the home of four packages:
-* React Flow v11 `reactflow` [v11 branch](https://github.com/xyflow/xyflow/tree/v11)
-* React Flow v12 (not published yet) [packages/react](./packages/react)
+* React Flow 11 `reactflow` [v11 branch](https://github.com/xyflow/xyflow/tree/v11)
+* React Flow 12 (beta) `@xyflow/react` [packages/react](./packages/react)
* Svelte Flow `@xyflow/svelte` [packages/svelte](./packages/svelte)
* Shared helper library `@xyflow/system` [packages/system](./packages/system)
**We just moved repositories** from the @wbkd org to this one. React Flow v11 will remain on the [v11 branch](https://github.com/xyflow/xyflow/tree/v11). When we have a stable v12, the package name of React Flow will change from `reactflow` to `@xyflow/react`.
-## Commercial Usage
+## Commercial usage
**Are you using React Flow or Svelte Flow for a personal project?** Great! No sponsorship needed, you can support us by reporting any bugs you find, sending us screenshots of your projects, and starring us on Github 🌟
**Are you using React Flow or Svelte Flow at your organization and making money from it?** Awesome! We rely on your support to keep our libraries developed and maintained under an MIT License, just how we like it. For React Flow you can do that on the [React Flow Pro website](https://reactflow.dev/pro) and for both of our libraries you can do it through [Github Sponsors](https://github.com/sponsors/xyflow).
-## Getting Started
+## Getting started
-The best way to get started is to check out the [React Flow](https://reactflow.dev/learn) or [Svelte Flow](https://svelteflow.dev/learn) learn section. However if you want to get a sneak peek of how to install the and use the libraries you can see it here:
+The best way to get started is to check out the [React Flow](https://reactflow.dev/learn) or [Svelte Flow](https://svelteflow.dev/learn) learn section. However if you want to get a sneak peek of how to install and use the libraries you can see it here:
React Flow basic usage
@@ -151,6 +151,15 @@ npm install @xyflow/svelte
```
+## Releases
+
+For releasing packages we are using [changesets](https://github.com/changesets/changesets) in combination with the [changeset Github action](https://github.com/changesets/action). The rough idea is:
+
+1. create PRs for new features, updates and fixes (with a changeset if relevant for changelog)
+2. merge into main
+3. changset creates a PR that bumps all packages based on the changesets
+4. merge changeset PR if you want to release to Github and npm
+
## The xyflow team
React Flow and Svelte Flow are maintained by the team behind [xyflow](https://xyflow.com). If you need help or want to talk to us about a collaboration, reach out through our [contact form](https://xyflow.com/contact) or by joining our [Discord Server](https://discord.gg/Bqt6xrs).
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 00000000..df8f1670
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,13 @@
+# Examples for Testing & Development
+These examples are used for feature development and E2E testing.
+
+## Overview
+SvelteKit App with Svelte Flow examples at [`examples/svelte`](./svelte)
+
+Vite App with React Flow examples at [`examples/react`](./react)
+
+Astro App used for SSR testing at [`examples/astro-xyflow`](./astro-xyflow)
+
+## E2E
+
+For furhter documentation of E2E tests have a look at [`/tests/playwright`](/tests/playwright).
\ No newline at end of file
diff --git a/examples/astro-xyflow/package.json b/examples/astro-xyflow/package.json
index c5e498db..94d6e199 100644
--- a/examples/astro-xyflow/package.json
+++ b/examples/astro-xyflow/package.json
@@ -1,5 +1,5 @@
{
- "name": "astro",
+ "name": "astro-examples",
"type": "module",
"private": true,
"version": "0.0.1",
diff --git a/examples/astro-xyflow/src/components/ReactFlowExample/CustomNode.tsx b/examples/astro-xyflow/src/components/ReactFlowExample/CustomNode.tsx
index dc371239..6dc30709 100644
--- a/examples/astro-xyflow/src/components/ReactFlowExample/CustomNode.tsx
+++ b/examples/astro-xyflow/src/components/ReactFlowExample/CustomNode.tsx
@@ -7,7 +7,7 @@ const sourceHandleStyleB: CSSProperties = {
left: 'auto',
};
-const CustomNode: FC = ({ data, xPos, yPos }) => {
+const CustomNode: FC = ({ data, positionAbsoluteX, positionAbsoluteY }) => {
return (
<>
@@ -18,7 +18,7 @@ const CustomNode: FC = ({ data, xPos, yPos }) => {