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

import via standard es6 #23

Open
tobz-nz opened this issue Jan 17, 2024 · 5 comments
Open

import via standard es6 #23

tobz-nz opened this issue Jan 17, 2024 · 5 comments

Comments

@tobz-nz
Copy link

tobz-nz commented Jan 17, 2024

As more people start ditching js build pipelines it would be great to support importing via standard ES6 modules.
Any chance of getting some pre-compiled dist assets that can be imported directly in client-side js?

@slavarazum
Copy link
Contributor

You can use es6 import as usual:

import { WaveConnector } from "laravel-wave"

Am I missing something?

@tobz-nz
Copy link
Author

tobz-nz commented Jan 19, 2024

@slavarazum Sorry, yeah I wasn't very clear that what I meant was when no build step is used.

What file/url would I import in my javascript (I.E. no Node, no build step at all - just a js file in the public folder.)

import { WaveConnector } from "https://jsdelivr.com/..../laravel-wave/....js"

@slavarazum
Copy link
Contributor

Looks like I need to dig deeper into this topic.

You can import Wave from jsdelivr with the following instruction for now:
https://www.jsdelivr.com/package/npm/laravel-wave

Do you have any clear examples of libraries which satisfy your needs?
In addition, do you use Wave with Echo or standalone? If you use it with Echo, does Echo support the import type you need?

@tobz-nz
Copy link
Author

tobz-nz commented Jan 20, 2024

@slavarazum Ah yes I forgot jsdeliver does that automatic conversion thing. That should do, for now at least.

I've not used Wave yet, but planning on using it in a new project (and maybe replacing pusher & ably in a couple of other projects too)
Not sure if I'll use with Echo or stand alone yet.

I think Alpine is good example - though I now notice they are just using jsdeliver as well..

@slavarazum
Copy link
Contributor

@tobz-nz Got you! Let me know when you have your first experience.

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