Skip to content

Commit

Permalink
chore(deps): Upgraded yoga to v2 and removed bundled package
Browse files Browse the repository at this point in the history
  • Loading branch information
mskec committed Jan 5, 2024
1 parent 9f7a2df commit 119b808
Show file tree
Hide file tree
Showing 77 changed files with 47 additions and 16,375 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-boats-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/layout': minor
---

Upgraded yoga to v2 and dropped bundled yoga v1 package
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ module.exports = {
'react/jsx-filename-extension': 0,
'react/jsx-props-no-spreading': 1,
'react/destructuring-assignment': 0,
'import/no-unresolved': ['error', { ignore: ['^yoga-layout'] }],
},
};
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
projects: [
'<rootDir>packages/fns',
'<rootDir>packages/yoga',
'<rootDir>packages/font',
'<rootDir>packages/image',
'<rootDir>packages/render',
Expand Down
4 changes: 2 additions & 2 deletions packages/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@react-pdf/stylesheet": "^4.1.8",
"@react-pdf/textkit": "^4.2.0",
"@react-pdf/types": "^2.3.4",
"@react-pdf/yoga": "^4.1.2",
"cross-fetch": "^3.1.5",
"emoji-regex": "^10.2.1",
"queue": "^6.0.1"
"queue": "^6.0.1",
"yoga-layout": "^2.0.1"
},
"devDependencies": {
"jest-fetch-mock": "^2.1.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/image/measureImage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import getRatio from './getRatio';
import getMargin from '../node/getMargin';
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/getBorderWidth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const getComputedBorder = (yogaNode, edge) =>
yogaNode ? yogaNode.getComputedBorder(edge) : 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/getMargin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const getComputedMargin = (node, edge) => {
const { yogaNode } = node;
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/getPadding.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const getComputedPadding = (node, edge) => {
const { yogaNode } = node;
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setAlign.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import { upperFirst } from '@react-pdf/fns';

const ALIGN = {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setBorderWidth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setYogaValue from './setYogaValue';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setDisplay.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

/**
* Set display attribute to node's Yoga instance
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setFlexDirection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const FLEX_DIRECTIONS = {
row: Yoga.FLEX_DIRECTION_ROW,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setFlexWrap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const FLEX_WRAP = {
wrap: Yoga.WRAP_WRAP,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setGap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import { isNil, matchPercent } from '@react-pdf/fns';

const checkPercents = (attr, value) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setJustifyContent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import { isNil } from '@react-pdf/fns';

const JUSTIFY_CONTENT = {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setMargin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setYogaValue from './setYogaValue';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setOverflow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import { isNil } from '@react-pdf/fns';

const OVERFLOW = {
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setPadding.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setYogaValue from './setYogaValue';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setPosition.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setYogaValue from './setYogaValue';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/node/setPositionType.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import { isNil } from '@react-pdf/fns';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/steps/resolveDimensions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';
import * as P from '@react-pdf/primitives';
import { isNil, compose } from '@react-pdf/fns';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/svg/measureSvg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

const getAspectRatio = viewbox => {
if (!viewbox) return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/text/measureText.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */

import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import layoutText from './layoutText';
import linesWidth from './linesWidth';
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/getBorderWidth.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import getBorderWidth from '../../src/node/getBorderWidth';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/getMargin.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import getMargin from '../../src/node/getMargin';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/getPadding.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import getPadding from '../../src/node/getPadding';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setAlignContent.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setAlignContent from '../../src/node/setAlignContent';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setAlignItems.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setAlignItems from '../../src/node/setAlignItems';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setAlignSelf.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setAlignSelf from '../../src/node/setAlignSelf';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setBorderWidth.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setBorder, {
setBorderTop,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setDisplay.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setDisplay from '../../src/node/setDisplay';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setFlexDirection.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setFlexDirection from '../../src/node/setFlexDirection';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setFlexWrap.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setFlexWrap from '../../src/node/setFlexWrap';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setJustifyContent.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setJustifyContent from '../../src/node/setJustifyContent';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setMargin.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setMargin, {
setMarginTop,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setOverflow.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setOverflow from '../../src/node/setOverflow';

Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setPadding.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setPadding, {
setPaddingTop,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setPosition.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setPosition, {
setPositionTop,
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tests/node/setPositionType.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Yoga from '@react-pdf/yoga';
import Yoga from 'yoga-layout/sync';

import setPositionType from '../../src/node/setPositionType';

Expand Down
1 change: 0 additions & 1 deletion packages/yoga/.gitignore

This file was deleted.

43 changes: 0 additions & 43 deletions packages/yoga/CHANGELOG.md

This file was deleted.

24 changes: 0 additions & 24 deletions packages/yoga/README.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/yoga/babel.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/yoga/index.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/yoga/index.js

This file was deleted.

30 changes: 0 additions & 30 deletions packages/yoga/package.json

This file was deleted.

25 changes: 0 additions & 25 deletions packages/yoga/rollup.config.js

This file was deleted.

Loading

0 comments on commit 119b808

Please sign in to comment.