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

Separate the svelte component and the js wrapper #372

Open
AlexRMU opened this issue Dec 15, 2023 · 5 comments
Open

Separate the svelte component and the js wrapper #372

AlexRMU opened this issue Dec 15, 2023 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@AlexRMU
Copy link

AlexRMU commented Dec 15, 2023

It would be nice to bring all the functionality that is needed for use without svelte into a separate component that will be imported from js.
And the pure svelte component will be imported from svelte.
You also need to make native events in the svelte component (and pass them above), and use callbacks in the wrapper, etc.

@josdejong
Copy link
Owner

I'm not entirely sure what you mean, do you mean to move the stuff related to the vanilla-jsoneditor into a separate repo? There is no "js wrapper", it is only a build script that generates a vanilla JS bundle using rollup.

@AlexRMU
Copy link
Author

AlexRMU commented Dec 16, 2023

The main component has updateProps and other things that are required for vanilla js. This can be moved to a separate component. In addition, it has a size of 500 lines, it is better to reduce it somehow.
Plus, you can add a bunch of slots to be able to replace some components.

@AlexRMU
Copy link
Author

AlexRMU commented Dec 16, 2023

Blocked by #373

@josdejong
Copy link
Owner

Yeah, that can be interesting. It would be neat to separate the stuff related to the vanilla-package from the svelte-version. It should not introduce friction though to implement a feature or fix and then deploy both packages (right now all of that goes in one go).

Is this something you would like to try out?

@AlexRMU
Copy link
Author

AlexRMU commented Dec 18, 2023

I think you can just export the svelte component and the wrapper component separately
sveltejs/kit#8825
sveltejs/kit#8922
https://kit.svelte.dev/docs/packaging#anatomy-of-a-package-json-exports

@josdejong josdejong added the help wanted Extra attention is needed label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants