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

Allow users to opt-in to the EnterprisePlugin (or at least to select it's order) #11278

Open
1 task done
juanjoDiaz opened this issue Jul 25, 2022 · 2 comments
Open
1 task done

Comments

@juanjoDiaz
Copy link
Contributor

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Use case description

Currently, serverless automatically includes @serverless/dashboard-plugin and probably other libraries only needed when using enterprise feature. The user should be able to opt-in to this instead of having it installed regardless of whether it will be used or not.

Furthermore, the dashboard plugin is always installed last. So, it's impossible to do anything in the plugin that should be executed after the dashboard plugin

Proposed solution (optional)

Ideally, all enterprise features should not be include by default. You could, for example, use a peer-dependency @serverless/enterprise that the user can install to pull in all enterprise features and libraries.

Furthermore, the dashboard plugin should be declared like any other plugin so you can decide in which order it runs.

@pgrzesik
Copy link
Contributor

Hey @juanjoDiaz - thanks for reporting. I see the reasoning behind your suggestion, I believe the way it is set up right now was introduced out of convenience to not require users to explicitly include the plugin. Also, there are some changes already introduced for Serverless Console where the setup happens a bit differently (without additional plugin).

Is there anything that was made harder due to the fact that plugin is introduced? It shouldn't really impact anything if Dashboard integration is not enabled.

@juanjoDiaz
Copy link
Contributor Author

Serverless dashboard currently conflicts with one of my plugins: juanjoDiaz/serverless-plugin-warmup#310.
I'm pretty sure it also conflicts with my middleware plugin and there are just no dashboard users using that plugin.

The solution to the issue is a problem with dashboard that I already create a PR for: serverless/dashboard-plugin#693

However, I can see this lack of flexibility in the order that the plugins are added if you want to create a plugin that does something after the dashboard wrapper has been applied.

Also, on a more philosophical thinking, serverless shouldn't download stuff that is not needed nor used by the user.
I know that the whole npm is build in a way that every time that you add a dependency, a million packages get added.
But we, as package authors, should try to minimize this.

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

No branches or pull requests

2 participants