Giter VIP home page Giter VIP logo

Comments (7)

KeironLowe avatar KeironLowe commented on July 20, 2024 1

@moeamaya Respectfully, I disagree with throwing an exception. Rellax is a nice to have and typically isn't required for the page to work so throwing an exception and stopping the entire script from executing doesn't make sense to me. Rellax should definitely not run if no elements exist, but I don't believe stopping other JS from running is right.

I think throwing a warning instead would be more appropriate.

from rellax.

moeamaya avatar moeamaya commented on July 20, 2024

@mattclough1 Can you instantiate rellax only on the pages you need?

from rellax.

mattclough1 avatar mattclough1 commented on July 20, 2024

@moeamaya yeah, I just went ahead and checked whether the element was available before instantiating... depending on how someone is using Rellax, an exception is probably appropriate. In my case it's embellishment. Disregard! 😅

from rellax.

moeamaya avatar moeamaya commented on July 20, 2024

Hey I know how it goes when you're trying to ship your site, so no worries.

I think i am going to keep the throw because I think it's best practice and breaking JS is maybe a feature in this case.

from rellax.

hitaspdotnet avatar hitaspdotnet commented on July 20, 2024

Similar issue without bundling

from rellax.

moeamaya avatar moeamaya commented on July 20, 2024

@KeironLowe How dare you say Rellax is "a nice to have" it's as critical as babel 😜

But okay I hear you all, and I recant my original position. If anyone wants to make a PR happy to merge without the blocking exception.

from rellax.

KeironLowe avatar KeironLowe commented on July 20, 2024

@moeamaya Some would say even more critical! Thanks, I've just submitted a PR.

from rellax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.