inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.3k stars 423 forks source link

Non optimised production build? #1804

Closed jamesh-purr closed 4 months ago

jamesh-purr commented 7 months ago

Version:

Describe the problem:

Using very bare bones app.js file still triggers googles reduce unused javascript. I have tried a lot of things with vite and I still can't get this issue resolved.

Steps to reproduce:

import { createInertiaApp } from '@inertiajs/vue3'; createInertiaApp({ setup({ el, App, props }) {

},

});

first is size of app.js and second is savings it could make with removed js code. …assets/app-06b5762a.js(example-app.test) | 56.8 KiB | 44.1 KiB

Any ideas or any possible way to get this to stop triggering google's page speed warnings?

jameshulse commented 7 months ago

Someone else has raised some PRs to address some of this: https://github.com/inertiajs/inertia/pull/1791 and https://github.com/inertiajs/inertia/pull/1792.

jamesh-purr commented 7 months ago

Oh I see @jameshulse thanks for pointing out already open tasks for this issue.

jamesh-purr commented 7 months ago

Hey @reinink

https://github.com/inertiajs/inertia/pull/1792 https://github.com/inertiajs/inertia/pull/1791

As the two pull requests above have been refused and closed this is still an issue and by google standards inertia isn't optimised.

wilsenhc commented 4 months ago

It would be a great addition to fix this issue, reducing bundle size is always good

driesvints commented 4 months ago

Looks like we won't change anything here sorry.

RomainLanz commented 4 months ago

Looks like we won't change anything here sorry.

Can we know the reason at least? It seems to be a simple, non-breaking and needed change (as shared in both linked PR)

reinink commented 4 months ago

@RomainLanz Hey! Only reason is for fear of breaking changes...I worry there are going to be subtle differences in the implementation of these that could break existing apps in unexpected ways.

Similar suggestions have been made in the past — for example it's been recommended that we use fetch instead of xhr so we can avoid the axios dependency, but what people don't realize is that fetch doesn't support file upload progress.

I'd like to replace the lodash dependencies eventually, but do it with some kind of beta release as you suggested in another issue 👍

RomainLanz commented 3 months ago

Do you have any news on this work? May I create a fork of the @inertia/core package to lower the build size?

Currently, most of the Inertia size is from axios (unnecessary) and qs (not needed either).

RomainLanz commented 1 month ago

Since Inertia 2 is approaching, can we move on and start changing those dependencies? It can be a great time to do so since it will be a major release with expected breaking changes.