Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@inertiajs/core
Advanced tools
@inertiajs/core is a JavaScript library that allows developers to build modern single-page applications (SPAs) using classic server-side routing and controllers. It provides a way to create reactive, dynamic web applications without the need for a full client-side framework.
Page Rendering
This feature allows you to render pages using Inertia. The code sample demonstrates how to set up an Inertia app with Vue.js, resolving pages dynamically and mounting them to the DOM.
import { createInertiaApp } from '@inertiajs/core';
createInertiaApp({
resolve: name => require(`./Pages/${name}`),
setup({ el, App, props }) {
new Vue({
render: h => h(App, props),
}).$mount(el);
},
});
Form Handling
Inertia provides a useForm hook to handle form submissions easily. The code sample shows how to create a form object, bind it to form fields, and submit it to a server endpoint with success handling.
import { useForm } from '@inertiajs/core';
const form = useForm({
name: '',
email: '',
});
form.post('/submit', {
onSuccess: () => alert('Form submitted successfully!'),
});
Navigation
Inertia allows for seamless navigation between pages without full page reloads. The code sample demonstrates how to programmatically navigate to a different page using Inertia's visit method.
import { Inertia } from '@inertiajs/core';
function navigateToProfile() {
Inertia.visit('/profile');
}
React Router is a standard library for routing in React applications. It allows for dynamic routing and navigation within React apps. Unlike @inertiajs/core, which integrates server-side routing with client-side rendering, React Router is purely client-side and requires a React environment.
Vue Router is the official router for Vue.js, enabling navigation and routing in Vue applications. It provides similar client-side routing capabilities as React Router but is specific to Vue.js. In contrast, @inertiajs/core is framework-agnostic and can be used with multiple front-end frameworks.
Next.js is a React framework that provides server-side rendering and static site generation. It offers a more comprehensive solution for building full-stack applications compared to @inertiajs/core, which focuses on SPA-like behavior with server-side routing.
Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
Visit inertiajs.com to learn more.
$page
and $inertia
(#1393)usePage
generic type (#1396)Method
enum with the Link component (#1392)usePage
generic type (#1394)useForm
(#1413)setup
prop types (#1418)Head
component (#1433)FAQs
A framework for creating server-driven single page apps.
The npm package @inertiajs/core receives a total of 107,761 weekly downloads. As such, @inertiajs/core popularity was classified as popular.
We found that @inertiajs/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.