Skip to content

Commit a256737

Browse files
committed
Resolve react relative to app
1 parent 9ea9318 commit a256737

File tree

4 files changed

+63
-38
lines changed

4 files changed

+63
-38
lines changed

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@
9090
"resolutions": {
9191
"@parcel/watcher": "~2.2.0",
9292
"@vue/compiler-sfc": "~3.2.47",
93-
"vue": "~3.2.47",
94-
"react": "file:/Users/devongovett/dev/react/build/node_modules/react",
95-
"react-dom": "file:/Users/devongovett/dev/react/build/node_modules/react-dom"
93+
"vue": "~3.2.47"
9694
}
9795
}

packages/examples/react-server-components/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
},
1919
"dependencies": {
2020
"express": "^4.18.2",
21-
"react": "18.3.0-canary-feed8f3f9-20240118",
22-
"react-dom": "18.3.0-canary-feed8f3f9-20240118",
21+
"react": "^19",
22+
"react-dom": "^19",
2323
"react-server-dom-parcel": "file:/Users/devongovett/dev/react/build/node_modules/react-server-dom-parcel",
2424
"rsc-html-stream": "0.0.4"
2525
},

packages/runtimes/rsc/src/RSCRuntime.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import {Runtime} from '@parcel/plugin';
44
import nullthrows from 'nullthrows';
55
import {urlJoin} from '@parcel/utils';
6+
import path from 'path';
67

78
export default (new Runtime({
89
apply({bundle, bundleGraph}) {
@@ -163,8 +164,10 @@ export default (new Runtime({
163164

164165
code += ' </>;\n}\n';
165166

167+
let filePath = nullthrows(node.value.sourcePath);
168+
let ext = path.extname(filePath);
166169
runtimes.push({
167-
filePath: __filename + 'x',
170+
filePath: filePath.slice(0, -ext.length) + '.jsx',
168171
code,
169172
dependency: node.value,
170173
env: {sourceType: 'module'},

yarn.lock

+56-32
Original file line numberDiff line numberDiff line change
@@ -12292,10 +12292,29 @@ [email protected]:
1229212292
iconv-lite "0.4.24"
1229312293
unpipe "1.0.0"
1229412294

12295-
[email protected], react-dom@^17.0.2, react-dom@^18.2.0, "react-dom@file:/Users/devongovett/dev/react/build/node_modules/react-dom":
12295+
react-dom@^17.0.2:
12296+
version "17.0.2"
12297+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
12298+
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
12299+
dependencies:
12300+
loose-envify "^1.1.0"
12301+
object-assign "^4.1.1"
12302+
scheduler "^0.20.2"
12303+
12304+
react-dom@^18.2.0:
12305+
version "18.3.1"
12306+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
12307+
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
12308+
dependencies:
12309+
loose-envify "^1.1.0"
12310+
scheduler "^0.23.2"
12311+
12312+
react-dom@^19:
1229612313
version "19.0.0"
12314+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57"
12315+
integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==
1229712316
dependencies:
12298-
scheduler "^0.23.0"
12317+
scheduler "^0.25.0"
1229912318

1230012319
1230112320
version "6.0.9"
@@ -12350,8 +12369,25 @@ react-use@^17.4.0:
1235012369
ts-easing "^0.2.0"
1235112370
tslib "^2.1.0"
1235212371

12353-
[email protected], react@^17.0.2, react@^18.2.0, "react@file:/Users/devongovett/dev/react/build/node_modules/react":
12372+
react@^17.0.2:
12373+
version "17.0.2"
12374+
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
12375+
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
12376+
dependencies:
12377+
loose-envify "^1.1.0"
12378+
object-assign "^4.1.1"
12379+
12380+
react@^18.2.0:
12381+
version "18.3.1"
12382+
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
12383+
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
12384+
dependencies:
12385+
loose-envify "^1.1.0"
12386+
12387+
react@^19:
1235412388
version "19.0.0"
12389+
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd"
12390+
integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==
1235512391

1235612392
read-cache@^1.0.0:
1235712393
version "1.0.0"
@@ -13001,13 +13037,26 @@ saxes@^6.0.0:
1300113037
dependencies:
1300213038
xmlchars "^2.2.0"
1300313039

13004-
scheduler@^0.23.0:
13040+
scheduler@^0.20.2:
13041+
version "0.20.2"
13042+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
13043+
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
13044+
dependencies:
13045+
loose-envify "^1.1.0"
13046+
object-assign "^4.1.1"
13047+
13048+
scheduler@^0.23.2:
1300513049
version "0.23.2"
1300613050
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
1300713051
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
1300813052
dependencies:
1300913053
loose-envify "^1.1.0"
1301013054

13055+
scheduler@^0.25.0:
13056+
version "0.25.0"
13057+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015"
13058+
integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==
13059+
1301113060
screenfull@^5.1.0:
1301213061
version "5.2.0"
1301313062
resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba"
@@ -13643,7 +13692,7 @@ string-natural-compare@^3.0.1:
1364313692
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
1364413693
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==
1364513694

13646-
"string-width-cjs@npm:string-width@^4.2.0":
13695+
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1364713696
version "4.2.3"
1364813697
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1364913698
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -13669,15 +13718,6 @@ string-width@^1.0.1, string-width@^1.0.2:
1366913718
is-fullwidth-code-point "^2.0.0"
1367013719
strip-ansi "^4.0.0"
1367113720

13672-
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
13673-
version "4.2.3"
13674-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
13675-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
13676-
dependencies:
13677-
emoji-regex "^8.0.0"
13678-
is-fullwidth-code-point "^3.0.0"
13679-
strip-ansi "^6.0.1"
13680-
1368113721
string-width@^5.0.1, string-width@^5.1.2:
1368213722
version "5.1.2"
1368313723
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -13778,7 +13818,7 @@ stringify-object@^3.3.0:
1377813818
is-obj "^1.0.1"
1377913819
is-regexp "^1.0.0"
1378013820

13781-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
13821+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1378213822
version "6.0.1"
1378313823
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1378413824
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -13799,13 +13839,6 @@ strip-ansi@^4.0.0:
1379913839
dependencies:
1380013840
ansi-regex "^3.0.0"
1380113841

13802-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
13803-
version "6.0.1"
13804-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
13805-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
13806-
dependencies:
13807-
ansi-regex "^5.0.1"
13808-
1380913842
strip-ansi@^7.0.1:
1381013843
version "7.1.0"
1381113844
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -15327,7 +15360,7 @@ [email protected]:
1532715360
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b"
1532815361
integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==
1532915362

15330-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
15363+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
1533115364
version "7.0.0"
1533215365
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1533315366
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -15353,15 +15386,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
1535315386
string-width "^4.1.0"
1535415387
strip-ansi "^6.0.0"
1535515388

15356-
wrap-ansi@^7.0.0:
15357-
version "7.0.0"
15358-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
15359-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
15360-
dependencies:
15361-
ansi-styles "^4.0.0"
15362-
string-width "^4.1.0"
15363-
strip-ansi "^6.0.0"
15364-
1536515389
wrap-ansi@^8.1.0:
1536615390
version "8.1.0"
1536715391
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)