inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Non optimised production build?

Open jamesh-purr opened this issue 1 year ago • 3 comments

Version:

  • @inertiajs/vue3 version: ^1.0.0

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?

jamesh-purr avatar Feb 21 '24 13:02 jamesh-purr

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.

jameshulse avatar Feb 23 '24 22:02 jameshulse

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

jamesh-purr avatar Feb 26 '24 13:02 jamesh-purr

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.

jamesh-purr avatar Mar 05 '24 09:03 jamesh-purr

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

wilsenhc avatar May 20 '24 15:05 wilsenhc

Looks like we won't change anything here sorry.

driesvints avatar May 21 '24 08:05 driesvints

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)

RomainLanz avatar May 21 '24 08:05 RomainLanz

@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 👍

reinink avatar May 21 '24 13:05 reinink

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 avatar Jul 02 '24 07:07 RomainLanz

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.

RomainLanz avatar Aug 29 '24 07:08 RomainLanz