Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
3KB web components + lit-html + redux library without bloat.
fit-html is a combination of lit-html, web components and redux bringing efficient rendering and a functional application architecture together. Yet, the total size of the framework is below 3KB, including dependencies.
You need the following:
import { connect, withStore } from 'fit-html';
import { html } from 'lit-html/lib/lit-extended';
import { createStore } from 'redux';
Set up redux store:
const todos = (state = [], action) => {
switch (action.type) {
case 'ADD_TODO':
return state.concat([action.text]);
default:
return state;
}
};
const store = createStore(todos, ['Use Redux']);
Define actions and view:
function addTodo() {
return {
type: 'ADD_TODO',
text: `Hello ${Math.random()}`
};
}
const render = ({ addTodo, todos }) => html`
<ul>
${todos.map(text => html`<li>${text}</li>`)}
</ul>
<button on-click="${addTodo}">
Add
</button>
`;
const TodosApp = connect(
state => ({ todos: state }),
{ addTodo }
)(render);
// Define the custom element.
//
// The withStore mixin is only required for the root element of your
// app. All other 💪-elements will get the redux store from that element.
customElements.define('todo-app', withStore(store)(TodosApp));
index.html
:
<html>
<head>
<title>My cool 💪-html app</title>
</head>
<body>
<todo-app></todo-app>
</body>
</html>
Please see https://github.com/Festify/fit-html-demo for more and larger examples.
💪-html is written for use with evergreen browsers. Not so much for Internet Explorer (though we strive to become compatible with IE11 once lit-html itself is).
MIT
FAQs
3KB functional Web Components without bloat
We found that fit-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.