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

ci(): bug report form #8315

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
b641fa8
Update README.md
ShaMan123 Aug 26, 2022
eb27fd6
Create LICENSE.md
ShaMan123 Aug 26, 2022
10be4d7
Update README.md
ShaMan123 Aug 26, 2022
f52628f
Update README.md
ShaMan123 Aug 26, 2022
874ec76
Update README.md
ShaMan123 Aug 26, 2022
e4bafda
Update README.md
ShaMan123 Aug 26, 2022
c840e17
Update README.md
ShaMan123 Aug 26, 2022
e80f10c
Update bug_report.md
ShaMan123 Aug 26, 2022
8144420
Update bug_report.md
ShaMan123 Aug 26, 2022
f36642a
Merge branch 'master' into readme
ShaMan123 Aug 26, 2022
d7c347a
Merge branch 'master' into readme
ShaMan123 Aug 27, 2022
5591a1b
Squashed commit of the following:
ShaMan123 Aug 27, 2022
c0764b7
dep wiki
ShaMan123 Aug 27, 2022
ad0753e
Update CONTRIBUTING.md
ShaMan123 Aug 27, 2022
4cef45d
Update README.md
ShaMan123 Aug 27, 2022
5d8db2f
Update CONTRIBUTING.md
ShaMan123 Aug 27, 2022
36f50a7
Update CONTRIBUTING.md
ShaMan123 Aug 28, 2022
855237d
Update CONTRIBUTING.md
ShaMan123 Aug 28, 2022
c13dfea
Create Gotchas.md
ShaMan123 Aug 28, 2022
5b94617
Revert "Create Gotchas.md"
ShaMan123 Aug 28, 2022
164c90a
Create GOTCHAS.md
ShaMan123 Aug 28, 2022
069b6b3
Update CONTRIBUTING.md
ShaMan123 Aug 28, 2022
f8cb97f
Update README.md
ShaMan123 Aug 28, 2022
e5fb097
Update README.md
ShaMan123 Aug 28, 2022
9524c91
Update GOTCHAS.md
ShaMan123 Aug 28, 2022
136d0e5
Update GOTCHAS.md
ShaMan123 Aug 28, 2022
61d9ce5
Update GOTCHAS.md
ShaMan123 Aug 28, 2022
f6ce88e
Update object_geometry.mixin.ts
ShaMan123 Aug 28, 2022
6040e02
Merge branch 'readme' of https://github.com/fabricjs/fabric.js into r…
ShaMan123 Aug 28, 2022
0b16270
Update GOTCHAS.md
ShaMan123 Aug 28, 2022
3f3eaf9
Merge branch 'master' into readme
ShaMan123 Aug 30, 2022
6491c4e
Update README.md
ShaMan123 Aug 30, 2022
cc1b68b
Update README.md
ShaMan123 Aug 30, 2022
341a5e3
Update README.md
ShaMan123 Aug 30, 2022
3b79b07
Update README.md
ShaMan123 Aug 30, 2022
90a1a7e
Update README.md
ShaMan123 Aug 30, 2022
38dabda
Update README.md
ShaMan123 Aug 30, 2022
1bc309f
Update GOTCHAS.md
ShaMan123 Sep 2, 2022
1c79acb
Update bug_report.md
ShaMan123 Sep 3, 2022
bc01719
Update bug_report.md
ShaMan123 Sep 3, 2022
da81671
Merge branch 'master' into readme
ShaMan123 Sep 3, 2022
fe60c80
Merge branch 'master' into readme
ShaMan123 Sep 5, 2022
c78c887
Merge branch 'master' into readme
ShaMan123 Sep 11, 2022
f55a0dc
Update CONTRIBUTING.md
ShaMan123 Sep 12, 2022
dbf89ce
Update CONTRIBUTING.md
ShaMan123 Sep 12, 2022
2a249b2
Update CONTRIBUTING.md
ShaMan123 Sep 12, 2022
695d2d2
Update CONTRIBUTING.md
ShaMan123 Sep 19, 2022
c3e3e86
Merge branch 'master' into readme
ShaMan123 Sep 19, 2022
5808ea2
Merge branch 'readme' of https://github.com/fabricjs/fabric.js into r…
ShaMan123 Sep 19, 2022
c7c47d2
Update bug_report.md
ShaMan123 Sep 19, 2022
b42d3a1
fix typo + prettier took control
ShaMan123 Sep 19, 2022
8f66434
Merge branch 'readme' of https://github.com/fabricjs/fabric.js into r…
ShaMan123 Sep 19, 2022
20af349
Update README.md
ShaMan123 Sep 20, 2022
c4a178f
Update CONTRIBUTING.md
ShaMan123 Sep 20, 2022
0dea20c
Update CONTRIBUTING.md
ShaMan123 Sep 20, 2022
0d46f32
Update CONTRIBUTING.md
ShaMan123 Sep 20, 2022
85538d2
Update CONTRIBUTING.md
ShaMan123 Sep 20, 2022
c9be536
Update README.md
ShaMan123 Sep 20, 2022
34d0090
Update CONTRIBUTING.md
ShaMan123 Sep 20, 2022
74cb7c0
Update README.md
ShaMan123 Sep 22, 2022
73ff932
Update CONTRIBUTING.md
ShaMan123 Sep 22, 2022
52d5df7
Create bug_report.yml
ShaMan123 Sep 25, 2022
700850d
Update bug_report.yml
ShaMan123 Sep 25, 2022
e36bcd4
Update bug_report.yml
ShaMan123 Sep 25, 2022
550a6d3
Update bug_report.yml
ShaMan123 Sep 25, 2022
e8f15ec
Update bug_report.yml
ShaMan123 Sep 25, 2022
7642167
Update bug_report.yml
ShaMan123 Sep 25, 2022
06f08e8
Update README.md
ShaMan123 Sep 25, 2022
fd4e927
Update bug_report.yml
ShaMan123 Sep 25, 2022
0e3fec0
Merge branch 'readme' into bug-report-form
ShaMan123 Sep 25, 2022
ded037c
Update bug_report.yml
ShaMan123 Sep 25, 2022
5f17283
Update bug_report.yml
ShaMan123 Sep 25, 2022
9254b01
updater
ShaMan123 Sep 25, 2022
e3c414b
updated
ShaMan123 Sep 25, 2022
c234f3d
Update updateBugReportVersion.mjs
ShaMan123 Sep 25, 2022
f7ec253
Revert "updated"
ShaMan123 Sep 25, 2022
03accbc
js-yaml
ShaMan123 Sep 25, 2022
679e170
Update bug_report.yml
ShaMan123 Sep 25, 2022
cba700e
Update updateBugReportVersion.mjs
ShaMan123 Sep 25, 2022
5b1a785
Update bug_report.yml
ShaMan123 Sep 27, 2022
db61ae3
Update bug_report.yml
ShaMan123 Sep 27, 2022
7c526cd
Update bug_report.yml
ShaMan123 Sep 27, 2022
f697249
Update bug_report.yml
ShaMan123 Sep 27, 2022
a5670da
Update bug_report.yml
ShaMan123 Sep 27, 2022
a1f5fd8
Update bug_report.yml
ShaMan123 Sep 27, 2022
61b2a41
Merge branch 'master' into bug-report-form
ShaMan123 Sep 27, 2022
f472621
checkout
ShaMan123 Sep 27, 2022
9460710
Delete bug_report.md
ShaMan123 Sep 27, 2022
7d6d65f
Revert "Update bug_report.yml"
ShaMan123 Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

128 changes: 128 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: 🐛 Bug Report
description: File a bug report
title: '[Bug]: '
body:
- type: markdown
attributes:
value: |
Thank you for wanting to create an issue in this repository.
Before you do, please ensure you are filing the issue in the right place.

* If you have a question or if an issue is not right for what you mean to file use [Discussions](https://github.com/fabricjs/fabric.js/discussions).

- type: checkboxes
id: terms
attributes:
label: CheckList
description: >-
By submitting this issue, you agree to follow our [Code of
Conduct](https://github.com/fabricjs/fabric.js/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
- label: >-
I have read and followed the [Contributing
Guide](https://github.com/fabricjs/fabric.js/CONTRIBUTING.md)
required: true
- label: >-
I have read and followed the [Issue Tracker
Guide](https://github.com/fabricjs/fabric.js/CONTRIBUTING.md#%EF%B8%8F-issue-tracker)
required: true
- label: I have searched and referenced existing issues and discussions
required: true
- label: >-
I am filing a **BUG** report.
required: true
- label: >-
I have managed to reproduce the bug **after** upgrading to the
**latest** version
required: true
- label: I have created an accurate and minimal reproduction
required: true
- type: dropdown
id: version
attributes:
label: version
description: >-
If you are working on a version below latest you should upgrade to
latest before filing a bug report, your issue might have been resolved
already.
options:
- 5.2.4
validations:
required: true
- type: dropdown
id: environments
attributes:
label: In What environments are you experiencing the problem?
description: >-
checkout the [supported
browsers](/README.md#supported-browsersenvironments)
multiple: true
options:
- Firefox
- Chrome
- Safari
- Opera
- Microsoft Edge
- Node.js
- type: input
id: node_version
attributes:
label: Node Version (if applicable)
validations:
required: false
- type: input
id: reproduction_link
attributes:
label: Link To Reproduction
description: >
A good reproduction helps us UNDERSTAND your issue, find the bug and fix
it quickly.

Take the time and put effort into making your reproduction accurate and
minimal.

Use the following reproduction templates.


- [Browser reproduction template](https://jsfiddle.net/Lcp2h3nv/)

- [Node reproduction
template](https://codesandbox.io/s/exciting-browser-ytb701)


⛔ No reproduction === closed issue ⛔
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps To Reproduce
value: |
1.
2.
3.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual Behavior
description: Provide screenshots/screencasts if relevant
validations:
required: true
- type: textarea
id: error
attributes:
label: Error Message & Stack Trace
description: Provide logging outputs/errors if relevant
render: bash
validations:
required: false
53 changes: 53 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Pull Request
about: Creating a PR
---

<!--
Hi there!
Thanks for taking the time and putting the effort into making fabric better! 💖
Take a look at /CONTRIBUTING.md for crucial instructions regarding local setup, testing etc.
https://github.com/fabricjs/fabric.js/blob/master/CONTRIBUTING.md

Adding tests that verify your fix and safegurad it from unwanted loss and changes is a MUST.

PRing is not always simple, don't hestitate to ask for help (beware of 'em gotchas 😓).
We appreciate your effort and would like the process to be productive and enjoyable.
A strong community means a strong and better product for everyone.
-->

<!--
📣 IMPORTANT NOTICE - PR LOCKDOWN 🔒 04/2022
We are excited to announce that fabric is migrating to modern typescript/javascript 🤩.
This means we will ⛔ not be accepting any PRs out of scope with the migration.
We understand this might be annoying but wasted work is ever more so.
The migration will be extreme on the source code so PRs from before will probably become stale to the point of death after the migration.
It hurts us the throw away good work, effort and time put into fabric so please stay patient.
You are welcome to join the migration effort 🔨
https://github.com/fabricjs/fabric.js/issues/7596

If you remain strong minded about PRing and the fix is small you can submit a PR to the 5.x branch
During the migration we will port these changes to master
-->

## Motivation

<!-- Why you are proposing -->
<!-- You can use the @closes notation to mark issues that will be resolved by this PR -->

## Description

<!-- What you are proposing -->

## Changes

<!-- before the fix vs. after -->

## Gist

<!-- Technical stuff if necessary -->

## In Action

<!-- Show case your accomplishment -->
<!-- Upload screenshots, screencasts and live examples showing your fix in contrast to the current state -->
45 changes: 45 additions & 0 deletions GOTCHAS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- **Crazy DOM**\
`new fabric.Canvas('foo')` wraps `<canvas id="foo">` element with a `<div>` one, and adds another (absolutely positioned) canvas element on top of the existing canvas (the one with id="foo"). This only happens for dynamic canvases (`fabric.Canvas`), not static ones (`fabric.StaticCanvas`).\
See [[How fabric canvas layering works]].

- **Crazier fabric**\
Make sure you are not sharing an object (such as a `clipPath`) between render agents. In other words, keep the object tree simple and strict.

- **Object is NOT selectable**: `setCoords()`\
An object has a visual state and an coordinate state. Both can become stale.\
When the visual state is stale it is visible making it simple to catch. This is a bit different.\
When an object or its controls aren't interactive or don't match their visual position, it means the coordinate state is stale. This happens after changing a property that affects position.
Calling `object.setCoords()` should fix it.

- **Visuals NOT updating**: [Object Caching](http://fabricjs.com/fabric-object-caching)\
Consider marking the object as `dirty` before rendering.

- **Wrong position after loading from JSON**: increase `NUM_FRACTION_DIGITS`\
When dealing with serialization, floats can blows up the string size with unnecessary decimals. `NUM_FRACTION_DIGITS` controls the fraction digits in exporting methods (`toObject`, `toSVG`)

- **Mouse/Touch position is off**: `canvas.calcOffset()`\
This usually happens once the canvas' position in the `document` is changed **after** it had been initialized.

- **0.5 pixel position offset**: `strokeWidth`\
Most Objects have a transparent stroke of width 1 that shift them by 0.5 pixel horizontally and vertically.
Take this under consideration when positioning objects at an exact position.
This is to comply with SVG behavior.
You can always set `strokeWidth` to `0`.

- **Blurry visuals**: retina scaling\
Objects need a reference to `Canvas` for proper rendering.
Without the reference objects can't access the retina scaling value ([device pixel ratio](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#correcting_resolution_in_a_canvas)), resulting in bad resolution.
This usually happens when an object is a child of a custom object. Fix it by propagating `canvas` to the object in the parent's `_set` method **OR** better off, use `Group`, it is designed especially for building custom objects.

- **Object position in Group**\
An object in a group will relate to the group's center as (0, 0).
Read more about `Group`

- **Vanishing Object**\
It is likely you are misusing `Group` and the object tree because the vanished object thinks it is not within the canvas' visible viewport, indicating a severe **bug** in coordinate calculation. If you want to hack your way around it use `canvas.skipOffscreen` (recommended for triaging **ONLY**) with a significant performance hit.

- **Text BBOX is off**\
Make sure fonts have loaded before you create the `Text` object. Fabric needs the font to calculate the position and bounding box of the characters. Doing so prior to loading the font will lead to a bad calculation using a fallback font.

- **Editing Textbox on Mobile**: `dblclick`\
When trying to edit a textbox on mobile, users need to double-tap the same spot to enter edit mode - otherwise it just moves it around.
15 changes: 15 additions & 0 deletions scripts/updateBugReportVersion.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import fs from 'fs';
import cp from 'node:child_process';
import { fileURLToPath } from 'node:url';
import path from 'path';
import YAML from 'js-yaml';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const file = path.resolve(__dirname, '..', '.github/ISSUE_TEMPLATE/bug_report.yml');
const id = 'version';
const packageName = 'fabric';
const content = YAML.load(fs.readFileSync(file).toString());
const found = content.body.find(entry => entry.id === id && entry.type === 'dropdown');
const tags = JSON.parse(cp.execSync(`npm view ${packageName} versions --json`).toString()).reverse();
found.attributes.options = tags;
fs.writeFileSync(file, YAML.dump(content));
17 changes: 17 additions & 0 deletions src/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Copyright (c) 2008-2015 Printio (Juriy Zaytsev, Maxim Chernyak)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.