Skip to content

Conversation

@fregante
Copy link
Member

@fregante fregante commented Oct 30, 2021

Annual attempt at migrating to Parcel

Blocked by:


Missing (help wanted)

@fregante fregante added help wanted meta Related to Refined GitHub itself labels Oct 30, 2021
@fregante fregante changed the title Use Parcel POC: Use Parcel Oct 30, 2021
{
"mangle": false,
"format": {
"beautify": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this isn't being followed, I think it worked in previous Parcel betas. Not fundamental though.

@fregante fregante added the Please! ♥︎ Particularly useful features that everyone would love! label Oct 30, 2021
@cheap-glitch
Copy link
Contributor

cheap-glitch commented Oct 30, 2021

Out of curiosity, what are the advantages of using Parcel over Webpack in our case?

@fregante
Copy link
Member Author

fregante commented Oct 30, 2021

No config. We also have a dependency that we can't update because it's broken (size-plugin)

@fregante
Copy link
Member Author

fregante commented Nov 5, 2021

Maybe for Parcel 3

@fregante fregante restored the parcel-once-again branch November 20, 2021 18:08
@fregante fregante reopened this Nov 20, 2021
@fregante
Copy link
Member Author

Latest error:

Error: Cannot use import statement outside a module

  ./build/parcel-transformer-rgh/index.ts:1
  import {Transformer} from '@parcel/plugin';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
  at Object.compileFunction (node:vm:352:18)
  at wrapSafe (node:internal/modules/cjs/loader:1025:15)
  at Module._compile (node:internal/modules/cjs/loader:1059:27)
  at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
  at Module.load (node:internal/modules/cjs/loader:975:32)
  at NodePackageManager.load (./node_modules/@parcel/package-manager/lib/NodePackageManager.js:165:9)
  at NodePackageManager.require (./node_modules/@parcel/package-manager/lib/NodePackageManager.js:121:17)
  at async loadPlugin (./node_modules/@parcel/core/lib/loadParcelPlugin.js:185:16)
  at async ParcelConfig.loadPlugin (./node_modules/@parcel/core/lib/ParcelConfig.js:117:18)
  at async Promise.all (index 0)

which basically means Parcel is not loading it as a module after transpiling it.

@mischnic
Copy link

Sounds like you expect that Parcel transpiles plugins automatically/transparently? It doesn't. You have to ensure yourself that require("parcel-transformer-rgh") work correctly in Node.

@fregante
Copy link
Member Author

fregante commented Nov 20, 2021

Thanks for the comment! Indeed that's the issue. Maybe as a quick patch (without adding a whole build to this transformer) I can find an import() function that supports TS files, because that seems to be the last issue.

const {getFeatures, getFeaturesMeta} = await import("../../build/readme-parser.ts");

@fregante
Copy link
Member Author

Still blocked by

Will pick it up again once that's resolved somehow

@fregante fregante closed this Nov 22, 2021
@fregante fregante deleted the parcel-once-again branch November 22, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to Refined GitHub itself Please! ♥︎ Particularly useful features that everyone would love!

Development

Successfully merging this pull request may close these issues.

Write Webpack loader for readme.md

3 participants