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

Meta: Parse feature details at compile time #2167

Merged
merged 5 commits into from Jun 23, 2019

Conversation

fregante
Copy link
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
declare const __featuresList__: string[];
declare const __featuresInfo__: FeatureInfo[];
Copy link
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"
  }, ...
]

@@ -54,5 +54,4 @@ <h2 class="only-firefox">Options</h2>

</form>
<script src="browser-polyfill.min.js"></script>
<script src="content.js"></script>
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 is what matters

@@ -1,11 +1,35 @@
/// <reference types="./source/globals" />
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 also solves the // @ts-ignore issue below for size-plugin

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
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
help wanted meta Related to Refined GitHub itself
Development

Successfully merging this pull request may close these issues.

None yet

2 participants