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

Export some helper functions to make plugin creators get block's import request id easierly #321

Open
5 of 6 tasks
kainstar opened this issue Dec 28, 2023 · 0 comments
Open
5 of 6 tasks

Comments

@kainstar
Copy link

kainstar commented Dec 28, 2023

Related plugins

Description

I am developing a plugin to enable SFC's style to work in shadow DOM. My idea is to modify the SFC script block, import the style contents, and insert them into the shadow root at runtime. The problem is how to correctly write the source path for style imports.

The only solution I have thought of is copying code from plugin-vue to ensure that the logic matches that of the official version. However, this would require me to constantly synchronize with any changes made by the official version. It could also result in differences between my plugin's logic and that of the official version if users install an incompatible combination of plugin-vue and my plugin.

Therefore, I am wondering if it is possible to export some helper functions for plugin creators, which would allow us to easily write import request ids for blocks.

Suggested solution

For instance, a function that get the request id of a style block like:

function getStyleRequestId(descriptor: SFCDescriptor, index: number): string

Alternative

No response

Additional context

No response

Validations

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

1 participant