This repository was archived by the owner on Jan 16, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed the errors that pop up when you try to run this addon in fastboot. This was the error:
navigator
is used in swiper.js, so to fix it I've guarded the import in index.js as recommended here.Adding this guard caused an error with the instantiation of the
Swiper
inswiper-container
. To fix that, I moved it from being ininit
todidInsertElement
and removed theEmber.run.later
- I think this will result in the code being executed at about the same time as before?didInsertElement
isn't called by fastboot.Although these changes mean that the addon can be used in fastboot without causing errors, there's some room for improvement. The HTML representation rendered by fastboot just spits out the full html (all slides) - a more accurate representation might be just the first slide but I'm not familiar enough with swiper.js to cover other potential use cases. I think fixing the errors is a decent first step anyway.
Wasn't sure how to write tests for this either although that seems more like a limitation of fastboot right now.