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

Add webpack-extension-reloader and webextension-polyfill-ts #61

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

nikoisonfire
Copy link
Contributor

Added two tools (webextension-feedback-popup, webpack-extension-reloader) and a library (webextension-polyfill-ts)

Added two tools (webextension-feedback-popup, webpack-extension-reloader) and a library (webextension-polyfill-ts)
@@ -43,6 +43,7 @@ Code meant become part of the extension.
- [webext-storage-cache](https://github.com/fregante/webext-storage-cache) - Map-like promised cache storage with expiration.
- [webext-dynamic-content-scripts](https://github.com/fregante/webext-dynamic-content-scripts) - Automatically inject your `content_scripts` on custom domains.
- [mozilla/webextension-polyfill](https://github.com/mozilla/webextension-polyfill) - Polyfill to support the standardized promise based API in the `browser` namespace.
- [webextension-polyfill-ts](https://github.com/Lusito/webextension-polyfill-ts) - *TypeScript-ready* polyfill to support the standardized promise based API in the `browser` namespace.
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure I like this, I prefer just installing the types directly, which is already mentioned in the readme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really? One is without JS doc and the other one is chrome only. With manifest 3 coming you'd want an up-to-date doc, which @Lusito's plugin provides.

It's even mentioned in the Mozilla readme

webextension-polyfill-ts: Types and JS-Doc are automatically generated from the mozilla schema files, so it is always up-to-date with the latest APIs. It also bundles the webextension-polyfill for very simple usage.

Copy link
Owner

Choose a reason for hiding this comment

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

One is without JS doc

Which one is without JSDoc?

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/firefox-webext-browser/index.d.ts#L1061

the other one is chrome only

I assume you're referring to @types/chrome, which isn't mentioned in the docs.

With manifest 3 coming you'd want an up-to-date doc, which Lusito's plugin provides

And so does https://github.com/jsmnbom/definitelytyped-firefox-webext-browser

Copy link
Contributor Author

Choose a reason for hiding this comment

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

which is already mentioned in the readme
must have read over that line.

Copy link

Choose a reason for hiding this comment

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

I'm gonna go out on a limb here and say, that the definitelytyped project you mentioned can't have as complete code as my lib does. While it also fetches definitions from schemas to generate code, the schemas are quite flawed and need a lot of fixes.

Just by looking at the little code that is contained in the project to generate the types, it can't cover all the cases.

Copy link
Owner

Choose a reason for hiding this comment

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

Since you’re here, why are you wrapping the polyfill into its own module instead of taking the regular @types route like other type-less packages?

Copy link

Choose a reason for hiding this comment

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

Good question. Honestly not sure anymore. Probably historic reasons that no longer apply. I've never tried to contribute to @types. Will look into it.

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.

3 participants