Skip to content

Commit

Permalink
chore: upgrade parcel to v2 (#2385)
Browse files Browse the repository at this point in the history
* chore: upgrade from parcel-bundler to parcel, remove babel deps

* chore: remove babelrc from debugger-ui

* feat: make parcel use swc instead of babel

* chore: add .parcel-cache to ignored files

* fix: bundling errors

* fix: ignore main when building ui target

* update lockfile

* add --no-cache flag to avoid SIGSEGV error

---------

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
  • Loading branch information
jbroma and thymikee committed Jun 4, 2024
1 parent 5933018 commit 35ffa2e
Show file tree
Hide file tree
Showing 7 changed files with 1,293 additions and 2,469 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build/
coverage
!packages/cli-platform-ios/src/config/__fixtures__/native_modules/node_modules
*.env
.parcel-cache
3 changes: 0 additions & 3 deletions packages/cli-debugger-ui/.babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions packages/cli-debugger-ui/.parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.js": [
"@parcel/transformer-js"
]
}
}
12 changes: 6 additions & 6 deletions packages/cli-debugger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"name": "@react-native-community/cli-debugger-ui",
"version": "14.0.0-alpha.5",
"license": "MIT",
"main": "./build/middleware",
"main": "build/middleware/index.js",
"targets": {
"main": false
},
"scripts": {
"build": "yarn build:ui && yarn build:middleware",
"build:ui": "parcel build --no-content-hash src/ui/index.html --out-dir build/ui --public-url '/debugger-ui'",
"build:ui": "parcel build --no-cache --no-content-hash src/ui/index.html --dist-dir build/ui --public-url '/debugger-ui'",
"build:middleware": "tsc"
},
"files": [
Expand All @@ -14,12 +17,9 @@
"!*.map"
],
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/plugin-transform-runtime": "^7.6.2",
"parcel-bundler": "^1.12.5"
"parcel": "^2.12.0"
},
"dependencies": {
"@babel/runtime": "^7.8.4",
"serve-static": "^1.13.1"
},
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-debugger-ui",
Expand Down
6 changes: 2 additions & 4 deletions packages/cli-debugger-ui/src/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta charset="utf-8" />
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
<title>React Native Remote Debugging (Deprecated)</title>
<script src="./index.js"></script>
<script type="module" src="./index.js"></script>
</head>
<body>
<div class="content">
Expand Down Expand Up @@ -58,9 +58,7 @@
/>
Maintain Priority
</label>
<p>
React Native JS code runs as a web worker inside this tab.
</p>
<p>React Native JS code runs as a web worker inside this tab.</p>
<p>
Press <kbd id="shortcut" class="shortcut">⌘⌥I</kbd> to open Developer
Tools. Enable
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-debugger-ui/src/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ function connectToDebuggerProxy() {
// This worker will run the application JavaScript code,
// making sure that it's run in an environment without a global
// document, to make it consistent with the JSC executor environment.
worker = new Worker('./debuggerWorker.js');
const url = new URL('./debuggerWorker.js', import.meta.url);
worker = new Worker(url);
worker.onmessage = function (message) {
ws.send(JSON.stringify(message.data));
};
Expand Down
3,729 changes: 1,274 additions & 2,455 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 35ffa2e

Please sign in to comment.