Open nelsonic opened 1 year ago
With the addition of:
https://github.com/dwyl/app/blob/f6a0eff9e47120a37aea30953b34ad46662f0d11/web/index.html#L38
We now have a rudimentary "bot detector":
That means Lighthouse
/ PageSpeed Insights
will not load/execute any JavaScript
.
We definitely haven't made the problem "go away".
We've just created some "interactivity" for loading the Flutter Web App
.
That ... just happens to give us:
100
Performance Score πYes, this is "smoke and mirrors" because we haven't actually addressed the elephant in the room: main.dart.js
... π
But by drastically reducing the Time to Interactive
we let the page load 10x
faster on Mobile
. π±
Which is game-changing for UX
. π
I still very much want to figure out if we can reduce the size of main.dart.js
... π
But not as worried about it now during our MVP
. βΊοΈ
We know it's a "problem" but it's one people only experience once on their mobile device. 1οΈβ£
Because once the Flutter App
is loaded it's fast! π
PR: #327 π
At present there are a handful of instances of
<script>
in theindex.html
file:The first instance is just a variable that
Flutter
updates. Nothing to do here. https://github.com/dwyl/app/blob/af4e656aa5d84102f969b9ce3b336affda521ba2/index.html#L21-L24flutter.js
is already loaded afterDOM
with thedefer
keyword: https://github.com/dwyl/app/blob/af4e656aa5d84102f969b9ce3b336affda521ba2/index.html#L26The only way we can improve this is to dynamically create this
<script>
tag πͺ and only loadflutter.js
after theDOM
has finished loading. β³ I have an idea for how we can do this but it's going to require someJS
wizardry. π§The interesting (complex) part is
window.addEventListener('load' ...
block: https://github.com/dwyl/app/blob/af4e656aa5d84102f969b9ce3b336affda521ba2/index.html#L39-L54Todo
JS
after theDOM
has loaded.