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

Do You Want Support for Other Frameworks, Modularity and Tests? #2

Open
hedgehog125 opened this issue Apr 25, 2024 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hedgehog125
Copy link
Owner

I'd like to gauge the interest on this as I'm currently unsure if working on this project more is worthwhile. Has anyone found this project but decided against it due to its limitations (SvelteKit specific, lack of tests, no fallback routes)?


I'm currently thinking of splitting it into 3 or 4 separate NPM modules:

  • @versioned-worker/core: A library that handles the build and provides some reusable utilities. It would need some other code to use in a project. Handles the virtual modules in the worker hooks file.
  • @versioned-worker/sveltekit-adapter: Mostly just calls the core library after SvelteKit builds. Interacts with the Vite plugin somehow to get the additional build information.
  • @versioned-worker/svelte: Contains Svelte specific utilities and abstractions, including the ServiceWorker component and the Svelte specific parts of its logic.
  • @versioned-worker/vite-plugin: Would allow you to use the virtual modules the library generates. Could also be used without the adapter so Versioned Worker can be used with other frameworks.

Making it more modular like this should have 3 main advantages:

  • I can write a proper test suite for it, even if it's just for the core library.
  • It should make adding support for other frameworks relatively easy. The Vite plugin should work for some frameworks but each framework will need its own component to register and handle the Service Worker messages. For now, I don't plan on creating a complete equivalent to @versioned-worker/svelte for any other frameworks, but I think I'll make a basic React component.
  • I should be able to minimise the annoying packaging step which has potential to cause issues in the future.

Anyone have any thoughts? Even if you haven't looked at this framework too much? Or does anyone want to just express interest?

I'd also be open to help with this.

@hedgehog125 hedgehog125 added enhancement New feature or request help wanted Extra attention is needed labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant