Need advice about which tool to choose?Ask the StackShare community!

jQuery

193.6K
69.6K
+ 1
6.6K
Preact

441
290
+ 1
28
Add tool

Preact vs jQuery: What are the differences?

Introduction

Preact and jQuery are two popular JavaScript libraries used for front-end development. Preact is a lightweight alternative to React, while jQuery is known for simplifying HTML document traversal and manipulation, event handling, and animation.

  1. Virtual DOM: Preact uses a virtual DOM similar to React, where changes are batched and applied efficiently to the real DOM. In contrast, jQuery directly manipulates the DOM, which can sometimes lead to performance issues when dealing with complex applications.
  2. Component-based Architecture: Preact follows a component-based architecture similar to React, making it easier to create reusable and modular components. On the other hand, jQuery does not have a built-in component system, which can result in less organized and maintainable code.
  3. Size: Preact is significantly smaller in size compared to jQuery, making it a more lightweight option for projects where file size is a concern. This can lead to faster load times and improved performance in Preact-based applications.
  4. Syntax: Preact uses a JSX syntax similar to React, allowing developers to write components in a more declarative and intuitive way. In contrast, jQuery relies on manipulating HTML elements using a combination of selectors and method calls, which can be less structured and readable.
  5. Data Binding: Preact provides better support for data binding through its unidirectional data flow, which helps in maintaining a clear and predictable state management. While jQuery also offers data manipulation functionalities, it may require additional plugins or custom solutions for efficient data binding.
  6. Community and Ecosystem: Preact has a growing community and ecosystem, leveraging the features and tooling of React. jQuery, on the other hand, has been around for a longer time and has a vast library of plugins and resources available. However, the trend is shifting towards modern frameworks like Preact with more robust community support.

In Summary, Preact distinguishes itself from jQuery by its virtual DOM implementation, component-based architecture, smaller size, JSX syntax, data binding capabilities, and growing community support.

Decisions about jQuery and Preact
Peter Schmalfeldt
Senior Software Engineer · | 9 upvotes · 70.5K views

I have made an extended effort to drop frameworks completely if they are not actually needed. While I still use JS Frameworks like Vue, Angular and React ( if I have too ), I see far too often devs / teams deciding to build a single page site entirely in a framework, rather than just using HTML, CSS and a little JS.

I personally feel it's important to know when a framework is a good solution, and maybe when it's overkill.

See more
Malek Boubakri
Web developer at Quicktext · | 4 upvotes · 238.2K views

The project is a web gadget previously made using vanilla script and JQuery, It is a part of the "Quicktext" platform and offers an in-app live & customizable messaging widget. We made that remake with React eco-system and Typescript and we're so far happy with results. We gained tons of TS features, React scaling & re-usabilities capabilities and much more!

What do you think?

See more
kazi shahin
CTO at Blubird Interactive Ltd. · | 3 upvotes · 112.5K views

I've an eCommerce platform building using Laravel, MySQL and jQuery. It's working good and if anyone become interested, I just deploy the entire source cod e in environment / Hosting. This is not a good model of course. Because everyone ask for small or large amount of change and I had to do this. Imagine when there will be 100 separate deploy and I had to manage 100 separate source. So How do I make my system architecture so that I'll have a core / base source code. To make any any change / update on specific deployment, it will be theme / plugin / extension based . Also if I introduce an API layer then I could handle the Web, Mobile App and POS as well ? Is the API should be part of source code or a individual single API and all the deployment will use that API ?

See more
Manatsawin Hanmongkolchai
Chose
jQueryjQuery
over
ReactReact
in

When I started TipMe, I thought about using React frontend. At the end, plain, simple jQuery won.

I had to build this iteration of the site fast and by using jQuery I could keep using Django as a full stack development tool. One important point is Django form (combined with Django Bootstrap3) means that I don't have to reinvent form rendering again, which will be the case with React.

Over time, more interactivity seeped into the site and React components start making its way into the codebase.

I now wish the site is built using React so that I could add more user friendly interfaces easier (no more fuddling with server states) but I would still say jQuery helped me get past those early days.

See more
Damiano Magrini
Chose
PreactPreact
over
ReactReact

Preact offers an API which is extremely similar to React's for less than 10% of its size (and createElement is renamed to h, which makes the overall bundle a lot smaller). Although it is less compatible with other libraries than the latter (and its ecosystem is nowhere as developed), this is generally not a problem as Preact exposes the preact/compat API, which can be used as an alias both for React and ReactDOM and allows for the use of libraries which would otherwise just be compatible with React.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of jQuery
Pros of Preact
  • 1.3K
    Cross-browser
  • 957
    Dom manipulation
  • 809
    Power
  • 660
    Open source
  • 610
    Plugins
  • 459
    Easy
  • 395
    Popular
  • 350
    Feature-rich
  • 281
    Html5
  • 227
    Light weight
  • 93
    Simple
  • 84
    Great community
  • 79
    CSS3 Compliant
  • 69
    Mobile friendly
  • 67
    Fast
  • 43
    Intuitive
  • 42
    Swiss Army knife for webdev
  • 35
    Huge Community
  • 11
    Easy to learn
  • 4
    Clean code
  • 3
    Because of Ajax request :)
  • 2
    Powerful
  • 2
    Nice
  • 2
    Just awesome
  • 2
    Used everywhere
  • 1
    Improves productivity
  • 1
    Javascript
  • 1
    Easy Setup
  • 1
    Open Source, Simple, Easy Setup
  • 1
    It Just Works
  • 1
    Industry acceptance
  • 1
    Allows great manipulation of HTML and CSS
  • 1
    Widely Used
  • 1
    I love jQuery
  • 15
    Lightweight
  • 5
    Drop-in replacement for React
  • 4
    Performance
  • 3
    Props/state passed to render
  • 1
    ES6 class components

Sign up to add or upvote prosMake informed product decisions

Cons of jQuery
Cons of Preact
  • 6
    Large size
  • 5
    Sometimes inconsistent API
  • 5
    Encourages DOM as primary data source
  • 2
    Live events is overly complex feature
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    - No public GitHub repository available -

    What is jQuery?

    jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.

    What is Preact?

    Preact is an attempt to recreate the core value proposition of React (or similar libraries like Mithril) using as little code as possible, with first-class support for ES2015. Currently the library is around 3kb (minified & gzipped).

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use jQuery?
    What companies use Preact?
    Manage your open source components, licenses, and vulnerabilities
    Learn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with jQuery?
    What tools integrate with Preact?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    What are some alternatives to jQuery and Preact?
    Bootstrap
    Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.
    JavaScript
    JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
    React
    Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
    AngularJS
    AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you use good old HTML (or HAML, Jade and friends!) as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly. It automatically synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data binding.
    jQuery Mobile
    jQuery Mobile is a HTML5-based user interface system designed to make responsive web sites and apps that are accessible on all smartphone, tablet and desktop devices.
    See all alternatives