Skip to content

Replace Webpack with Rollup - #7472

Merged
fregante merged 36 commits into
mainfrom
rollup
Aug 26, 2024
Merged

fregante merged 36 commits into
mainfrom
rollup

Conversation

@fregante

@fregante fregante commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

I'm interested in Rollup's ability to spit out independent files instead of a single bundle.

This is not done yet, it's having issues with the .d.ts import rollup/plugins#992

@fregante

This comment was marked as outdated.

Comment thread build/readme-parser.js Resolved
Comment thread rollup.config.js
styles(),
string({
include: '**/*.gql',
}),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread rollup.config.js Resolved
Comment thread .github/workflows/test.yml Resolved

@fregante fregante left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The extension is completely unbundled now 🎉

Screenshot 2

It looks like I'm missing:

  • CSS extraction
  • manifest.json copy to dist
  • Restore RelativeCI stats
  • Ensure it still works

@fregante

This comment was marked as outdated.

@fregante fregante changed the title POC Rollup Replace Webpack with Rollup Aug 19, 2024
@fregante

Copy link
Copy Markdown
Member Author

Wah… have we finally reached this point? It appears to work 😱

I've been trying to move off of Webpack for years and we've finally come full circle:

Complexity-wise, the advantages of Rollup over Webpack are minor or non-existent, but we gain the ability to output separate files. This means we will be able to drop hacks like id: import.meta.url and features.log.error(import.meta.url). Also any uncaught errors are no longer attached to refined-github.js but to the specific file (or feature) where they are thrown.

These improvements can come later, when our new Rollup build has been validated.

@fregante
fregante marked this pull request as ready for review August 19, 2024 17:32
@fregante

Copy link
Copy Markdown
Member Author

A couple of warnings:


(!) "this" has been rewritten to "undefined"
https://rollupjs.org/troubleshooting/#error-this-is-undefined
node_modules/webext-options-sync-per-domain/index.js
1: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
                     ^
2:     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key...
3:     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, targe...
...and 1 other occurrence
(!) Circular dependency
source/github-helpers/github-token.ts -> source/github-helpers/api.ts -> source/github-helpers/github-token.ts

@fregante fregante mentioned this pull request Aug 20, 2024
@fregante

fregante commented Aug 23, 2024 •

Copy link
Copy Markdown
Member Author

@kidonng @yakov116 does anyone of you run a dev version daily? It would be good to test-drive this version as your daily version.

@busches it would be particularly good to check for regressions on GHE as well.

I didn't see issues but I'm nervous to merge it 😅

A pre-built version can be found at the bottom of the artifacts page: https://github.com/refined-github/refined-github/actions/runs/10530672758?pr=7472

@yakov116

Copy link
Copy Markdown
Member

I can use it for the next few days

@fregante
fregante enabled auto-merge (squash) August 26, 2024 19:09
@fregante

Copy link
Copy Markdown
Member Author

SHIPPING TIME

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

Development

Successfully merging this pull request may close these issues.

Build broken on Node 22 Windows

2 participants