Skip to content

Conversation

@fregante
Copy link
Member

@fregante fregante commented Jun 19, 2024

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.

styles(),
string({
include: '**/*.gql',
}),
Copy link
Member Author

Choose a reason for hiding this comment

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

This could use a GQL-specific plugin in the future, but for now it's 1:1 for easier upgrade.

Copy link
Member Author

@fregante fregante left a comment

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 fregante added the meta Related to Refined GitHub itself label Aug 19, 2024
@fregante
Copy link
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
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
Copy link
Member Author

fregante commented Aug 23, 2024

@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
Member

I can use it for the next few days

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

SHIPPING TIME

@fregante fregante merged commit a4ecb58 into main Aug 26, 2024
@fregante fregante deleted the rollup branch August 26, 2024 19:11
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