Repository navigation
probe: recognise an empty SPA shell, send a SPA to its API before its sitemap - #4
Merged
Merged
Conversation
… its sitemap Angular CLI builds serve <app-root></app-root> without ng-version, and inlined CSS can make the shell larger than 200 KB. The probe saw no SPA and chose the sitemap (tier 1), whose addresses all serve the same empty shell. visible_words() counts the text outside scripts and styles; an empty mount element with module scripts, or a known framework, with fewer than 50 visible words is a SPA. A SPA now goes to tier 4 with the hint to read the application code for its data API, before the sitemap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A real audit of a court database built with Angular CLI showed two faults in
sap probe:<app-root></app-root>, module scripts, 1 visible word. Modern Angular builds do not writeng-versionin the served HTML, and the inlined CSS made the shell 130 KB (other shells pass 200 KB). The probe reportedSPA probable : False.main-*.jsand the chunks as text, as the skill says).What
visible_words(html): the words outside scripts, styles,noscriptandtemplate.<app-root._decide_tier_doors: a SPA goes to tier 4 before the sitemap, with the hint « chercher l'API de données dans le code de l'application (scripts lus comme texte, jamais exécutés), sinon Chrome » and a note that the sitemap only lists addresses.Failing first
Without the change in
accesspath/probe.py, 3 of the 4 tests oftests/test_spa_coquille.pyfail (the fourth checks that a page with text is not a SPA):Full suite: 781 passed. Live probe on the audited site: tier 4,
frameworks: ['angular'],SPA probable : True.