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

Expose types for plugin's main function #336

Closed
Milly opened this issue May 1, 2024 · 4 comments
Closed

Expose types for plugin's main function #336

Milly opened this issue May 1, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@Milly
Copy link
Contributor

Milly commented May 1, 2024

Exposes the type PluginMain for the plugin's main function.
Update the way to define the main function of the plugin as follows:

// New approach
export const main: PluginMain = (denops) => {
  // ...
};

There is a discussion in #332 about extending the definition of the plugin's main function.

@lambdalisue lambdalisue added documentation Improvements or additions to documentation enhancement New feature or request labels May 2, 2024
@lambdalisue
Copy link
Member

lambdalisue commented May 2, 2024

Actually, I usually prefer ordinal function style but the new approach has a big advantage so I'm positive to change the style.

What we need to updates are

@lambdalisue
Copy link
Member

Moreover, I believe there are more suitable names than "PluginMain" for the following reasons:

  • Developers are already aware that it's a plugin, hence the "Plugin" prefix seems somewhat redundant.
  • Although the function is named "main," it merely serves as a placeholder and doesn't elucidate the functionality. Therefore, the type name should offer a more descriptive insight.

Considering the aforementioned points, I suggest "Entrypoint" as the type name. What are your thoughts?

@lambdalisue lambdalisue added this to the v6.1 milestone May 2, 2024
@Milly
Copy link
Contributor Author

Milly commented May 3, 2024

I suggest "Entrypoint" as the type name. What are your thoughts?

Very good. I agree.

@lambdalisue lambdalisue modified the milestones: v6.1, v7.0 May 11, 2024
@lambdalisue
Copy link
Member

Now denops_std (v6.5.0) serve Entrypoint and we can define the main function like

import type { Entrypoint } from "https://deno.land/x/[email protected]/mod.ts";

export const main: Entrypoint = (denops) => {
  // ...
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants