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

Made tab reload optional - sometimes we have our own code to reinject… #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mikob
Copy link

@mikob mikob commented May 26, 2020

… content script necessities, or we don't have content script, and sometimes we don't want the page to refresh

mikob added 2 commits May 26, 2020 16:12
… content script necessities, or we don't have content script, and sometimes we don't want the page to refresh
@mikob mikob force-pushed the tab-refresh-optional branch from 3d98f1a to 6a48d8f Compare May 26, 2020 21:27
This was referenced May 26, 2020
@xpl
Copy link
Owner

xpl commented May 27, 2020

@mikob I wonder if we can read manifest.json and pull custom options from there instead of passing them down via a function call? I don't know if it's possible, but if it is, wouldn't it be a nicer option?

@mikob
Copy link
Author

mikob commented May 27, 2020

@xpl Why would that be nicer? That would be surprising IMO. I think it's best to follow standard, unsurprising practices and let options be passed in the same way they are with most other modules. I also think that the CRX reloading isn't closely tied with what's specified in manifest.json. eg. in my case I need to exclude hot-updated files (eg. the extension options page) from reloading the CRX because those are already injected and I don't want the options page to close as it does automatically when the CRX is reloaded.

@xpl
Copy link
Owner

xpl commented Jun 6, 2020

Why would that be nicer?

Because it would maintain the backward compatibility with the current "zero-configuration" version.

In the proposed new version users are supposed to explicitly pass the configuration to start watching files. That requires making changes to the code to make it work, right?

@xpl
Copy link
Owner

xpl commented Jun 6, 2020

Also, putting scripts/plugins options to manifest files is not unusual. For example, it is norm with package.json – often toolchain scripts read their (custom) options from there, and it's rather convenient because it keeps configuration away from the code.

Of course, providing the ability to configure from the code is also convenient, because it would allow to dynamically create those options in case if it's needed. So maybe it is good to support both ways, I dunno.

@xpl
Copy link
Owner

xpl commented Jun 6, 2020

Could you also please combine all your PRs into a single one? It would be easier to review and edit it then. They all seem linked and also all of them seem useful (there were prior requests to add file inclusion/exclusion), so if we are going to add that functionality, better add it all at once.

@mikob
Copy link
Author

mikob commented Jun 6, 2020

@xpl yes, it would be nice to have backwards compatibility but I think these changes warrant a major version bump/compatibility break? Configuration in package.json is usually for toolchain related stuff, as you said. Tools that can be configured in package.json like tslint, ava, tsconfig are never instantiated in user-land code so it makes sense that they configure in an external file. This library needs to be instantiated in userland... so it makes more sense that the configuration goes along with it when it's instantiated. If this were a webpack plugin, or otherwise didn't live in userland code, I would agree that configuration should be separated from userland code.

Could you also please combine all your PRs into a single one? It would be easier to review and edit it then. They all seem linked and also all of them seem useful (there were prior requests to add file inclusion/exclusion), so if we are going to add that functionality, better add it all at once.

You can see them all together in the final PR I made.

Lastly, I don't mean this in any passive-aggressive way, but just so you're not waiting around for it, I won't be making the changes to this PR. So someone else would need to pick up the slack if you're still unsatisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants