-
React: Desarrollado por Facebook, es muy utilizado para
construir interfaces de usuario.
-
Angular: Creado y mantenido por Google, es un framework
completo para aplicaciones web.
-
: Un framework
progresivo que se adapta fácilmente a las necesidades del proyecto.
-
: Ideal para
aplicaciones web ambiciosas, ofrece un flujo de trabajo muy estructurado.
-
Svelte: Un enfoque moderno que compila los componentes en
código JavaScript eficiente.
-
: Un marco
ligero que ofrece estructura al código de JavaScript.
| Característica |
Angular |
React |
|
|
Svelte |
|
| Sintaxis |
TypeScript |
JSX |
HTML-like templates |
Handlebars-like templates |
HTML-like templates |
JavaScript |
| Variables |
Declaradas con let y const |
Declaradas con let y const |
Declaradas con let y const |
Declaradas con let y const |
Declaradas con let y const |
Declaradas con var, let, const
|
| Comentarios |
// y /* */ |
// y /* */ |
// y /* */ |
// y /* */ |
// y /* */ |
// y /* */ |
| Data Binding |
Two-way |
One-way |
Two-way |
Two-way |
Reactive |
One-way |
| Componentes Reutilizables |
Sí |
Sí |
Sí |
Sí |
Sí |
No |
| Estructuración |
MVC |
Component-based |
Component-based |
MVC |
Component-based |
MVC |
| Virtual DOM |
No |
Sí |
Sí |
No |
No |
No |
| Funcionalidades |
Completo framework |
Librería para UI |
Framework progresivo |
Framework completo |
Compilador |
Framework ligero |
| Librerías |
Angular CLI, RxJS |
React Router, Redux |
Vue Router, Vuex |
Ember CLI, Ember Data |
Svelte Kit |
|
Angular
// app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `<h1>{{ title }}</h1>`
})
export class AppComponent {
title = 'Hello, Angular!';
}
React
// App.js
import React from 'react';
function App() {
return (
<div>
<h1>Hello, React!</h1>
</div>
);
}
export default App;
Vue.js
// main.js
import { createApp } from 'vue';
import App from './App.vue';
createApp(App).mount('#app');
// App.vue
<template>
<h1>{{ message }}</h1>
</template>
<script>
export default {
data() {
return {
message: 'Hello, Vue.js!'
};
}
};
</script>
Ember.js
// app/components/hello-world.js
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
export default class HelloWorldComponent extends Component {
@tracked message = 'Hello, Ember.js!';
}
// app/templates/components/hello-world.hbs
<h1>{{this.message}}</h1>
Svelte
<!-- App.svelte -->
<script>
let message = 'Hello, Svelte!';
</script>
<h1>{message}</h1>
Backbone.js
// index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.4.0/backbone-min.js"></script>
</head>
<body>
<div id="app"></div>
<script>
var AppView = Backbone.View.extend({
el: '#app',
initialize: function() {
this.render();
},
render: function() {
this.$el.html('<h1>Hello, Backbone.js!</h1>');
}
});
var appView = new AppView();
</script>
</body>
</html>
0 Comentarios