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 req #34

Closed
mihaimiculescu opened this issue Nov 2, 2019 · 5 comments
Closed

Support req #34

mihaimiculescu opened this issue Nov 2, 2019 · 5 comments

Comments

@mihaimiculescu
Copy link

From the Dialogs doc:
if I want to use Dialogs I need to import { Button, Dialog } from 'svelma'
But I need to use SSR,
from the npm page:

If you are doing server-side rendering with Sapper, you'll need to import the .svelte files directly so that your app can compile them, rather than importing from the compiled module.

So how should my import line read in order to be able to use Dialog the SSR way?

@rohfle
Copy link

rohfle commented Nov 6, 2019

Either of these ways should work

import { Button } from 'svelma/src/index.js';
import Button from 'svelma/src/components/Button.svelte';

Also see pull request #31 which should allow you to just import components directly when its merged

@mihaimiculescu
Copy link
Author

mihaimiculescu commented Nov 7, 2019

Thanks for the reply.
The Button line works OK. I already had tried it.
The problem is with the Dialog line.
I tried to replace

import { Button, Dialog } from 'svelma';

with

import Button from 'svelma/src/components/Button.svelte';
import Dialog from 'svelma/src/components/Dialog';

but the Dialog line is problematic. Even if I put

import Dialog from 'svelma/src/components/Dialog/Dialog.svelte';

I still get errors.

@rohfle
Copy link

rohfle commented Nov 7, 2019

import Dialog from 'svelma/src/components/Dialog';

and the demo code from the docs works for me on Svelma 0.3.0... I'm not using Sapper though...

What do the errors say?

@mihaimiculescu
Copy link
Author

mihaimiculescu commented Nov 8, 2019

Actually it was a doc glitch ...
The demo code from https://c0bra.github.io/svelma/components/dialog - first example uses Toast too:

  import { Button, Dialog } from 'svelma'

...

const thenHandler = result =>Toast.create(`You ${result ? 'confirmed' : 'canceled'}`)

etc
So, the import line for the first example should read
import { Button, Dialog, Toast } from 'svelma'
Otherwise, it generates errors.
Silly me - I could have noticed beforehand ... sry

Could you please fix the doc?

@c0bra
Copy link
Owner

c0bra commented Nov 21, 2019

Done, thanks for finding this!

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