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

chore: upgrade Parcel #813

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

chore: upgrade Parcel #813

wants to merge 17 commits into from

Conversation

louisgv
Copy link
Contributor

@louisgv louisgv commented Nov 10, 2023

Details

An initial attempt at upgrading Parcel. Tracking the following blockers:

I need help with:

  • The new parcel rust stuff seems to foobar'ed a lot of path resolution: Invalid path of @parcel\config-default\index.json parcel-bundler/parcel#9319
  • Fixing up the js packager (either rewrite it, patch it, or ping the Parcel devs to fix it)
  • There's a huge issue with the upstream resolver that's been around since 2.9.3, and doesn't seem to be fixed in 2.10.2. Need someone to triage and chase it down with the Parcel folks.
  • Upgrade our HMR pipeline, incorporating some idea from: https://github.com/parcel-bundler/parcel/pull/9068/files (Specifically, with how it handles non-code import. Basically they transformed it into a bundle of the file itself, and a CS to hot reload. Didn't know you can send out 2 bundles at once?!)
  • Test the updated framework out locally

If you're down to help, feel free to ping me on Discord or in the comment section.

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I agree to license this contribution under the MIT LICENSE
  • I checked the current PR for duplication.

Contacts

  • (OPTIONAL) Discord ID:

If your PR is accepted, we will award you with the Contributor role on Discord server.

To join the server, visit: https://www.plasmo.com/s/d

@louisgv louisgv added help wanted Extra attention is needed need test The issue require further testing, it might have been fixed labels Nov 10, 2023
@louisgv louisgv self-assigned this Nov 10, 2023
@louisgv
Copy link
Contributor Author

louisgv commented Nov 10, 2023

@seawatts
Copy link

seawatts commented Oct 1, 2024

Any progress here? It's blocking #1076

@tbrockman
Copy link
Contributor

tbrockman commented Oct 6, 2024

@seawatts I've started to work on this and have a branch which works for the most part, but it can't really be merged into main as is. Unfortunately there are some issues in the latest versions parcel (all the way up to the latest release, 2.12.0), one which leads to intermittent build failures (fixed in @nightly thankfully) and another which may cause runtime failures due to scope-hoisting removing necessary references (waiting response here parcel-bundler/parcel#9972).

Might be possible to cut a beta release for it though, but that'd be up to @louisgv.

# Conflicts:
#	api/messaging/package.json
#	api/persistent/package.json
#	api/selector/package.json
#	cli/plasmo/package.json
#	core/parcel-bundler/package.json
#	core/parcel-bundler/src/create-ideal-graph.ts
#	core/parcel-compressor-utf8/package.json
#	core/parcel-core/package.json
#	core/parcel-core/src/index.ts
#	core/parcel-core/src/resolve-options.ts
#	core/parcel-namer-manifest/package.json
#	core/parcel-optimizer-encapsulate/package.json
#	core/parcel-optimizer-es/package.json
#	core/parcel-packager/package.json
#	core/parcel-resolver-post/package.json
#	core/parcel-resolver/package.json
#	core/parcel-runtime/package.json
#	core/parcel-transformer-inject-env/package.json
#	core/parcel-transformer-inline-css/package.json
#	core/parcel-transformer-lab/package.json
#	core/parcel-transformer-manifest/package.json
#	core/parcel-transformer-svelte/package.json
#	core/parcel-transformer-vue/package.json
#	examples
#	package.json
#	packages/framework-shared/package.json
#	pnpm-lock.yaml
@pippinmole
Copy link
Collaborator

Hi @tbrockman, is it worth picking this back up?

@BalutaAlex
Copy link
Contributor

Hi, it looks like upgrading Parcel to a newer version would resolve many issues, as there has been significant development upstream. Can we come up with a plan for this? Some things to check in order to make this work, or maybe some historic context on how to upgrade it/or how things have been done.

cc @louisgv

@encodedz
Copy link

Hey, this PR looks like very much needed, as said it can potentially resolve alot of issue relating to parcel imports system.

@louisgv Do you think this one can be pushed?

@louisgv
Copy link
Contributor Author

louisgv commented Feb 19, 2025

@pippinmole @tbrockman thought? There are a couple of moving parts with the parcel core that I think would be nice to use upstream directly if it works :-?

@pippinmole
Copy link
Collaborator

@pippinmole @tbrockman thought? There are a couple of moving parts with the parcel core that I think would be nice to use upstream directly if it works :-?

Is it possible to upgrade mix and match parcel package (@parcel/*) versions or do we have to keep them all the same? Thinking of an iterative approach to the upgrade since there are a lot of issues upstream

# Conflicts:
#	api/messaging/package.json
#	api/persistent/package.json
#	api/selector/package.json
#	cli/create-plasmo/package.json
#	cli/plasmo/package.json
#	core/parcel-core/package.json
#	core/parcel-optimizer-es/package.json
#	core/parcel-resolver-post/package.json
#	core/parcel-resolver/package.json
#	core/parcel-runtime/package.json
#	core/parcel-transformer-inline-css/package.json
#	core/parcel-transformer-manifest/package.json
#	core/parcel-transformer-svelte/package.json
#	core/parcel-transformer-vue/package.json
#	package.json
#	pnpm-lock.yaml
@tbrockman
Copy link
Contributor

tbrockman commented Feb 19, 2025

Hey hey! I stopped working on this but https://github.com/tbrockman/plasmo/tree/parcel is available for reference (updates parcel dependencies, switches to using pnpm catalog: in the workspace to make it easier to bump shared dependencies across all workspace projects, removes some of the plasmo plugins which are presumably no longer necessary, and probably some other changes I can't remember).

Doesn't look like anything has changed as far as the blocker I ran into on my branch though. When using recursive pnpm commands (i.e, building examples here) module resolution would fail (though would pass when executing a single build):

with-tabs:build: @parcel/core: Failed to resolve '@plasmo-static-common/react' from 
with-tabs:build: './with-tabs/.plasmo/tabs/delta-flyer.tsx'
with-tabs:build:   /home/tbrockman/workspace/dev/plasmo/examples/with-tabs/.plasmo/tabs/delta-flyer.tsx:4:27
with-tabs:build:     3 | 
with-tabs:build:   > 4 | import { getLayout } from "@plasmo-static-common/react"
with-tabs:build:   >   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
with-tabs:build:     5 | 
with-tabs:build:     6 | // @ts-ignore
with-tabs:build: @parcel/resolver-default: Cannot find module '@plasmo-static-common/react'

At this point I think I lost motivation and just opted to start using esbuild for my projects instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed need test The issue require further testing, it might have been fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants