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

[FR] Include preact with static #4937

Closed
2 tasks done
matmair opened this issue May 31, 2023 · 5 comments
Closed
2 tasks done

[FR] Include preact with static #4937

matmair opened this issue May 31, 2023 · 5 comments
Labels
dependency Relates to a project dependency enhancement This is an suggested enhancement or new feature user interface User interface

Comments

@matmair
Copy link
Member

matmair commented May 31, 2023

Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find a similar feature request

Problem statement

Currently, every plugin needs to include their own version of preact and htm.

Suggested solution

Include https://esm.sh/htm/preact/standalone as a static file.

Describe alternatives you've considered

Vanilla js works, preact feels more intuitive.

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.
@matmair matmair added enhancement This is an suggested enhancement or new feature user interface User interface dependency Relates to a project dependency labels May 31, 2023
@matmair
Copy link
Member Author

matmair commented May 31, 2023

@inventree/triage opinions? 👍 / 👎

@wolflu05
Copy link
Contributor

wolflu05 commented May 31, 2023

I would strongly be about providing the complete source code for preact. I'm not sure if every company allows external requests to CDNs or even has an internet connection.

And in your description, I guess you mean htm right?

@SchrodingersGat
Copy link
Member

@matmair is preact a viable alternative to react for our purposes?

Also, if a plugin requires preact, can't it just load it from a CDN? It'll be cached anyway right?

@matmair matmair changed the title [FR] Include preact to staitc [FR] Include preact with static Jun 1, 2023
@matmair
Copy link
Member Author

matmair commented Jun 1, 2023

@SchrodingersGat for inserting small interactive elements into the UI yes. It works very nicely with the current setup. See Lukas bulk plugin for example.

The problem I am running into is the following: the new inventree-kom2 plugin will include preact and htm; Lukas plugin also includes those files - this leads to potential overloading of the namespace (with panels for example). Making things unstable.

@matmair
Copy link
Member Author

matmair commented Jul 13, 2023

Closing in favour of #5011

@matmair matmair closed this as completed Jul 13, 2023
@matmair matmair reopened this Jul 13, 2023
@matmair matmair closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Relates to a project dependency enhancement This is an suggested enhancement or new feature user interface User interface
Projects
None yet
Development

No branches or pull requests

3 participants