Comments (17)
@cjk7989 - you'd asked for feedback #663 (comment) so I wanted to give you a heads up. As much as it pains me, I think I'm going to downgrade to 1.1.3 and reimplement my workaround here:
Hi all, sorry for the issue, the reason might be that swa-cli uses wait-on to test if localhost should be resolved to ipv4 or v6, which causes a lot of await.
We will further investigate it and look for a good solution to support node 18 without loss of speed. Thanks for reporting that.
By the way, if you decide to downgrade to 1.1.3, then before doing that, please make sure your apis and database connection can work (which means your function-core-tools and dataApiBuilder has been correctly installed). If you are using dev servers like Angular and React, please set hostname to [::1] instead of localhost. Feel free to let me know your issue.
from static-web-apps-cli.
Just wanted to chime in here as well to say that this is my experience as well with 1.1.4
Here's a screenshot of my performance. I'm working with a Vue 3 + Vite 3.1.0 project. From what I've observed, it looks like the assets are being loaded in groups of 2-4 files, with about a 500ms delay between each group. It can take certain pages over a minute to load in like this, depending on the number of components required on the specific page.
Downgrading to 1.1.3 works on Node 18.18.0 for me; the delays are completely gone.
from static-web-apps-cli.
I've also experience similar behaviour. Using version 1.1.3 seems fine for me. But using 1.1.4 dramatically slows down loading. As a complete guess, maybe due to something in this commit: f1dd587916d76b267d0d46da47d26ea0ae898a22 . Great that it can now support node 18 though due to that commit.
from static-web-apps-cli.
I've raised a PR to revert the changes causing the slow proxying: #758
from static-web-apps-cli.
Just copying over from #758
Thanks for this - I did some testing on the perf differences between 1.1.3, 1.1.4 and 1.1.5 when it was in alpha state. Things have improved, but 1.1.5 is still roughly half the speed of 1.1.3.
I took our most demanding client side app, and timed the initial startup with 1.1.3, 1.1.4 and 1.1.5-alpha for comparison. 1.1.5-alpha was half as performant as 1.1.3 - see the screenshots from devtools below:
1.1.3
1.1.4
1.1.5-alpha
In response to this @cjk7989 has said:
Hi @johnnyreilly, we can't revert to 1.1.3 to speed up because the bug of resolving localhost will occur with node 18 in some systems. But I agree with you to record the successful responder and use that to steer all subsequent requests. We will design a fallback method to resolve requests in the future update. Thanks!
I'm quite keen on seeing what effect a fallback method might have on improving performance. In the meantime I'm glad things have improved between 1.1.4 and 1.1.5 ❤️
from static-web-apps-cli.
for anyone running into this issue, i just upgraded the swa cli to 1.1.6 and it seems to have a very positive effect on the load time.
from static-web-apps-cli.
This issue is still not fixed and the SWA CLI is practically unusable for local development beyond static testing.
This is clearly visible in a blank Nuxt app that takes around 15-30 seconds to refresh vs a few ms when opened directly.
Will this be fixed at some point @cjk7989 ?
from static-web-apps-cli.
I'm experiencing this behavior as well. I've ended up architecting my app around anything that doesn't force me to do a full page reload (I.e. avoiding stores) because the reload time is so slow.
from static-web-apps-cli.
As much as I love that a fix to #663 has landed - the performance issues really impair the developer experience. It's very slow.
@cjk7989 - you'd asked for feedback here so I wanted to give you a heads up. As much as it pains me, I think I'm going to downgrade to 1.1.3 and reimplement my workaround here:
https://johnnyreilly.com/static-web-apps-cli-node-18-could-not-connect-to-api
Sorry to be the bearer of not joyful feedback 😢
As a side note, I think Windows users running Node.js 18 might need 1.1.4 to be able to run. I'm using a Mac and so I don't - but I think me downgrading to 1.1.3 is not going to work for everyone.
from static-web-apps-cli.
FWIW, I'm using 1.1.3 with 18.17.0 without issue. App is a Vite/Vue application.
from static-web-apps-cli.
I had to downgrade to 1.0.3 to get dev server speed back to normal, guess node 18 will have to wait 🤷♂️
from static-web-apps-cli.
Also experienced this on 1.1.4, downgraded to 1.1.3.
from static-web-apps-cli.
Looking at jeffbski/wait-on#137 (comment)
It's possible that the Node.js 18 issue that lead to the changes in 1.1.4 and slowness may not surface in Node.js 20. If so, then the changes in 1.1.4 could be rolled back.
from static-web-apps-cli.
Ah it turns out that the SWA CLI doesn't presently support Node.js 20 and so testing this may be an issue:
from static-web-apps-cli.
In [email protected], we have reduced some delays so that the requests to dev servers will be handled faster. Please feel free to install it, and let us know if you think further optimization is needed.
from static-web-apps-cli.
Any updates with this? The developer experience with the static-wep-apps-cli is very poor, as a website that loads about 2 seconds in a local development scenario loads around 30-40 seconds with the cli.
from static-web-apps-cli.
I am experiencing the same problem on 1.1.7
from static-web-apps-cli.
Related Issues (20)
- Wildcard routes aren't supported properly in config HOT 2
- Outdated dependencies with moderate severity security issues (CVE-2023-45857) HOT 1
- Deploy purely static pages to SWA without creating a `public` subfolder HOT 2
- Unable to deploy SWA from Ubuntu ( `ubuntu-latest` on Azure Pipelines Hosted Agent)
- Deploying Blazor WASM to Azure Static Web App from Visual Studio
- Azure Static Web Apps Cli command failing on Linux
- Flaky CLI deployment HOT 3
- swa-cli.config.json "run" field <undefined>when "npm run vite:dev". Vite never runs
- SWA CLI and Visual Studio debugger does not connect in Visual Studio 17.8.6 HOT 2
- Dependency on json.schemastore.org breaks CLI HOT 21
- Pipelines fail due to https://json.schemastore.org/staticwebapp.config.json network timeout HOT 2
- Failed to load staticwebapp.config.json schema. Continuing without validation! HOT 3
- Old Data API builder version used HOT 3
- Custom SWA roles don't work in Data API builder HOT 1
- Deploy fails with no feedback, application is not deployed, stuck in "Uploading" forever HOT 4
- `swa [login|deploy]` fails with `Cannot spawn a message bus without a machine-id` in devcontainer
- Error message unclear when trying to deploy a Function with unsupported Node version
- No errors at deployment when using runtime v4 with managed functions
- Cannot deploy if app dist folder or function project is in project root
- SWA broken as of node version `20.13.0` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static-web-apps-cli.