Last active
July 8, 2022 20:39
-
-
Save andrewvmail/a94a5a3671a8f58300c3163d07042686 to your computer and use it in GitHub Desktop.
hot-fix-for-parcel-react-pdf-import-bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://github.com/diegomura/react-pdf/pull/1891 | |
set -eu | |
echo "[ post install script ] running hot-fix at post install" | |
patch -p0 --forward \ | |
node_modules/@react-pdf/renderer/lib/react-pdf.browser.es.js \ | |
scripts/renderer.patch || true | |
patch -p0 --forward \ | |
node_modules/@react-pdf/primitives/src/index.js \ | |
scripts/primitives.patch || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
..., | |
"scripts": { | |
"postinstall": "./scripts/hot-fix.sh", | |
}, | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- node_modules/@react-pdf/primitives/src/index.js 2022-06-04 16:38:56.091000000 -0700 | |
+++ "node_modules/@react-pdf/primitives/src/index copy.js" 2022-07-06 21:40:30.546641600 -0700 | |
@@ -22,3 +22,30 @@ | |
export const TextInstance = 'TEXT_INSTANCE'; | |
export const LinearGradient = 'LINEAR_GRADIENT'; | |
export const RadialGradient = 'RADIAL_GRADIENT'; | |
+ | |
+export default { | |
+ G, | |
+ Svg, | |
+ View, | |
+ Text, | |
+ Link, | |
+ Page, | |
+ Note, | |
+ Path, | |
+ Rect, | |
+ Line, | |
+ Stop, | |
+ Defs, | |
+ Image, | |
+ Tspan, | |
+ Canvas, | |
+ Circle, | |
+ Ellipse, | |
+ Polygon, | |
+ Document, | |
+ Polyline, | |
+ ClipPath, | |
+ TextInstance, | |
+ LinearGradient, | |
+ RadialGradient, | |
+} | |
\ No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- node_modules/@react-pdf/renderer/lib/react-pdf.browser.es.js 2022-07-05 00:02:28.704999000 -0700 | |
+++ "node_modules/@react-pdf/renderer/lib/react-pdf.browser.es copy.js" 2022-07-06 21:40:50.936641600 -0700 | |
@@ -1,5 +1,5 @@ | |
import _extends from '@babel/runtime/helpers/extends'; | |
-import * as primitives from '@react-pdf/primitives'; | |
+import primitives from '@react-pdf/primitives'; | |
export * from '@react-pdf/primitives'; | |
import queue from 'queue'; | |
import React, { useRef, useState, useEffect } from 'react'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment