cpreston321 / nuxt-swiper

Swiper.js for Nuxt
https://www.npmjs.com/package/nuxt-swiper
MIT License
220 stars 10 forks source link

🚨⚠️ Important Announcement ⚠️🚨 #55

Open cpreston321 opened 1 year ago

cpreston321 commented 1 year ago

Update 11-29-2023

Please test and try out the new swiper element release.

[!NOTE] This is still a work in progress as the api and helper compostables might change.

# npm
npm install nuxt-swiper@next

# yarn
yarn add nuxt-swiper@next

#pnpm
pnpm add nuxt-swiper@next

#bun
bun add nuxt-swiper@next

image

Moving forward Swiper.js is moving to web components. Removing support for Vue/React libraries in favor of web components. This means that nuxt-swiper will be obsolete in the coming months for the swiper/vue package. This means that if you see any bugs within the swiper/vue modules it's most likely it will not be fixed 🙁

So what does this mean?

Well this means that I will have to a totally re-write to support swiper/elements, Which in this case -- I really don't know if there is really any benefit of doing so when you can just import the element straight to your project to work out of the box. When creating nuxt-swiper I wanted to make it easier setting up swiper.js for my various personal projects and it worked for what I needed.


In the recent months I have been receiving issues that are non related to nuxt-swiper itself, as it makes swiper.js easier to work with all the great things Nuxt provides which is Auto Imports, Typescript types and the plug n' play module system it has. I've have been trying to help many people with there problems but some are just beyond my capabilities to fix since I do not maintain the swiper/core.

So I would love to discuss potentially implementing swiper/elements but I would love to talk to the community to see if it something that is even feasible to do. I appreciate everyone that has supported and starred the project! It means the world! Please feel free to discuss what you think below.

Links:

Thanks, CP 💚

FranciscoKloganB commented 1 year ago

I have no experience with Web Components, but what happens to TypeScript, do we go back to vanilla JavaScript when interacting with these?

Does it mean, we need also need go back to manually importing, every Module/CSS file that we want, explicitly?

Thanks for sharing.

cpreston321 commented 1 year ago

@FranciscoKloganB

Hey 👋! I will have to look into as I never worked with web components with Typescript but I think it's possible still but I just have to see how it works. I will let you know.

Technically yes but I could re-write the package to include the web components in this package so you wouldn't have to import manually. I just have to figure it out if it's even useful for everyone to make the change!

Thanks, CP

NnicanBuak commented 1 year ago

sub>@cpreston321</sub

Should we leave nuxt-swiper on the stable version of Swiper 8 which will still support Vue components or start a new branch with a module that will work with the new Swiper and will also provide a wrapper for the WebComponents?

I do not know what it is, but from the example code looks like the same as the usual components

cpreston321 commented 1 year ago

Hey @NnicanBuak!

I think the current version of Swiper 9 is best bet to keep bugs limited but knowing we are going to lose support for the main package will come will drawbacks including bugs which I don't control. I think we can keep it on Swiper 9 until compatibility is lost.

I do think it's feasible to do a major version bump to then support elements out of the box. I am going to look more into it to see if there is a way implement typescript types. If so that might be the best route.

FranciscoKloganB commented 1 year ago

I can try to gather as much information as I can, but I mostly a backend developer playing "the frontend world". 😅

If I find relevant information, I will share it here.

FranciscoKloganB commented 1 year ago

Have not been able to figure out much but here are the things that are "obvious" after trying to migrate from this package to web-components solution. There is way more boilerplate involved. Somethings about the web-components API appear a bit less straightforward.

Here is a list of a few things I had to do.