cdn-and-caching-strategy: any firebase.json counts as a web-serving surface, also one with no hosting
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- firebase, typescript
- Domain
- performance
Research direction
The file list is in src/laws/performance/cdn-caching-strategy.ts: WEB_SURFACE_FILES at line 18 includes firebase.json, and hasWebAssets around lines 33-36 returns true whenever that file exists. Change the check so firebase.json only counts when its parsed JSON has a hosting key. Done when a project whose firebase.json holds only firestore settings reports not applicable, and one with hosting still runs the law.
Written by the indexing model from the issue text.
Description
Version: 8.0.1 (tag v8.0.1)
Law: cdn-and-caching-strategy (CDN and Caching Strategy), CdnCachingStrategyLaw.hasWebAssets
What happens
WEB_SURFACE_FILES (src/laws/performance/cdn-caching-strategy.ts:18) lists firebase.json, and hasWebAssets (:33-36) returns true when the file exists. The law then judges the project for CDN configuration, browser caching headers and service-worker caching.
firebase.json configures several products. Only its hosting key declares something served to browsers; firestore, functions, storage and emulators do not.
Reproduction
A Python API (pyproject.toml, api/main.py with FastAPI) whose firebase.json is { "firestore": { "rules": "firestore.rules", "indexes": "firestore.indexes.json" } }, laws.enabled { "CDN and Caching Strategy": true }:
1. CDN and Caching Strategy [5 violations] (Score: 0/100)
• CDN configuration not implemented
• Browser caching headers not configured
• Service worker caching not implemented
Without firebase.json the same project gets "Not applicable — no web assets to serve".
What I ruled out
No other web-surface file and no JS/TS sources in the fixture: firebase.json alone switches the law on.
Why it matters
The law asks a JSON API for a service worker. The only ways out are a waiver or deleting a config the project needs for its database.
Suggested direction
- Count
firebase.jsonas a web surface only when it has ahostingkey. - Apply the same idea to other multi-purpose configs in the list where a key decides it (for example
wrangler.tomlwith[site]/assets).
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 2h 36m
- Merged PRs (30d)
- 168
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Rule-Of-Code/RoC
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Rule-Of-Code/RoC#548 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Rule-Of-Code/RoC#506 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Rule-Of-Code/RoC#501 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Rule-Of-Code/RoC#563 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 50/100
Rule-Of-Code/RoC#562 ·
Maintainers usually reply within 1 day
All issues in Rule-Of-Code/RoC
Similar issues
-
bug done
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
neavo/LinguaGacha#1124 ·
Maintainers usually reply within 1 day
-
[fullsend] E2E: backstage-microsoft-auth — catalogQuery missing error handler for network errorsPossibly taken @fullsend-ai-coder claimed this today. Opene2e-failure ready-to-code
Difficulty 2/5 Under an hour Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#4821 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
brylie/mission-island#225 ·
Maintainers usually reply within 1 day
-
status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-gemini/gemini-cli#30412 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day