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

creating a new instance of the toast class causes issues in SSR environments :( #3

Closed
NullVoxPopuli opened this issue Aug 3, 2018 · 4 comments

Comments

@NullVoxPopuli
Copy link

NullVoxPopuli commented Aug 3, 2018

Just upgraded to 1.0.0 from 0.1.0
The issue is that the default export in 1.0.0 is https://github.com/rfoel/bulma-toast/blob/master/src/js/index.js#L58 trying to access the document when bulma-toast is imported.

but in 0.1.0, just an function is exported: https://github.com/rfoel/bulma-toast/blob/0.1.0/src/extension.js#L7
so it's not evaluated until invocation time, allowing it to work in SSR environments. :-\

(for now, I'm downgrading back to 0.1.0 :-\ )

Ran in to this issue: ember-fastboot/ember-cli-fastboot#74 (for reference)

@rfoel
Copy link
Owner

rfoel commented Aug 3, 2018

I will probably revert it. I will try to keep it simple. Thanks for pointing it out.

@rfoel
Copy link
Owner

rfoel commented Aug 3, 2018

@NullVoxPopuli please check out the new version.

@rfoel rfoel closed this as completed Aug 3, 2018
@NullVoxPopuli
Copy link
Author

outside of server-side rendering, when I just swapped out the version in my package.json, I noticed this:
image

my options.position is is-right, when it should have been top-right, and I see now that the documentation is updated to use the new values. So, I think we're good! (I changed the value to one of the allowed values mentioned in the readme, and things behave as expected)

Thanks @rfoel !!! <3

@NullVoxPopuli
Copy link
Author

also, I love this:
image

https://github.com/NullVoxPopuli/react-parcel-playground
image

<3 Prequel Memes

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

2 participants