Skip to content

Meta: Parse feature details at compile time - #2167

Merged
fregante merged 5 commits into
masterfrom
feature-details-at-build-time
Jun 23, 2019
Merged

fregante merged 5 commits into
masterfrom
feature-details-at-build-time

Conversation

@fregante

Copy link
Copy Markdown
Member

Follows #2099

This avoids any issues/annoyances caused by loading content.js in the options.html page.

@fregante fregante added the meta Related to Refined GitHub itself label Jun 22, 2019
Comment thread source/globals.d.ts
}

declare const __featuresList__: string[];
declare const __featuresInfo__: FeatureInfo[];

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.

// __featuresList__ in background.js becomes:
[ "add-co-authored-by", "batch-open-issues", "branch-buttons", "bypass-checks", ...]
// __featuresInfo__ in options.js becomes:
[ {
    name: "add-co-authored-by",
    description: "Add co-authors when merging pull requests with multiple committers"
  }, {
    name: "batch-open-issues",
    description: "Open multiple issues in your repo at once"
  }, ...
]

Comment thread source/options.html

</form>
<script src="browser-polyfill.min.js"></script>
<script src="content.js"></script>

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.

This is what matters

Comment thread webpack.config.ts
@@ -1,11 +1,35 @@
/// <reference types="./source/globals" />

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.

This also solves the // @ts-ignore issue below for size-plugin

@fregante
fregante requested a review from sindresorhus June 22, 2019 13:32
Comment thread webpack.config.ts Resolved
fregante added a commit to notlmn/refined-github that referenced this pull request Jun 23, 2019
fregante added a commit to notlmn/refined-github that referenced this pull request Jun 23, 2019
@fregante

Copy link
Copy Markdown
Member Author

I'm gonna merge this because I'm having the exact problems that this change is meant to solve.

... but please review this code and maybe #2099 anyway just in case I'm doing something stupid.

@fregante
fregante merged commit 672793e into master Jun 23, 2019
@fregante
fregante deleted the feature-details-at-build-time branch June 23, 2019 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

2 participants