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

Support distribution of precompiled components #5455

Closed
TheComputerM opened this issue Sep 24, 2020 · 4 comments
Closed

Support distribution of precompiled components #5455

TheComputerM opened this issue Sep 24, 2020 · 4 comments

Comments

@TheComputerM
Copy link

This is mostly in regards to component libraries, particularly svelte-materialify. If I have to use my library with sapper, then I have to go through the hassle of installing all my dependencies such as svelte-preprocess, sass, postcss (see advanced install).

If someone who wants to use svelte-materialify with sapper he has to install all the dependencies and use the source files, it heavily impacts the development speed (compiling each component repeatedly). The current website of svelte materialify is made with sapper and a single reload takes about 15-30 seconds.

I propose that we add a svelte:ssr field in the package.json similar to svelte where the files compiled using generate: 'ssr' are located. This is a massive improvement to component authors and users who do not have to go through much hassle to setup their project.

@TheComputerM
Copy link
Author

TheComputerM commented Sep 24, 2020

I'd like to propose the addition of a svelte:ssr to package.json for ssr compiled modules.

This way we have:

  • svelte for generate: 'dom'
  • svelte:ssr for generate: 'ssr'

and sapper takes care of the client and server modules.

@TheComputerM
Copy link
Author

Just to be clear:
If I do: import { Button } from 'svelte-materialify';

Then sapper does:
import { Button } from 'svelte-materialify/dist/dom/index.js'; for client
and
import { Button } from 'svelte-materialify/dist/ssr/index.js'; for server

With the package.json being:

"svelte": "dist/dom/index.js",
"svelte:ssr": "dist/ssr/index.js",

@benmccann benmccann changed the title Add a svelte:ssr to package.json for ssr compiled modules. Support distribution of precompiled components Sep 24, 2020
@benmccann benmccann transferred this issue from sveltejs/sapper Sep 24, 2020
@benmccann
Copy link
Member

See #604 for some discussion of the reason it's currently done this way

@Conduitry
Copy link
Member

This is a big change and far-reaching, and, from the way part of it's being worded, sounds like a breaking one. This should be opened as an RFC.

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

No branches or pull requests

3 participants