Closed Bug 869709 Opened 12 years ago Closed 12 years ago

Define inline manifest API

Categories

(L20n :: HTML Bindings, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
1.0 beta

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(1 file, 1 obsolete file)

We currently have no way to inline the manifest.json file. It could be a win for fxos scenarios.
As a reminder, see https://github.com/l20n/l20n.js/blob/master/bindings/README.md for the current HTML API. Manifest files are linked to like so: <link rel="localization" href="../locales/browser.json">
Gandalf, do you have any perf numbers to share?
I mean, inlining the content of the manifest to halve the number of files loaded at startup.
I understand, I'm just wondering what the potential perf gain is. IIRC, last time we concluded that file IO *is not* where we should be looking for perf gains. Bug 868930 is related.
Last time I measured it was: manifest: 1106ms (24) no-manifest: 1067ms (16) I believe this number to be around 30-40ms.
Assignee: nobody → gandalf
Priority: -- → P2
Target Milestone: --- → 1.0 beta
Attached patch POC (obsolete) — Splinter Review
Reading the patch, it looks like the proposed syntax is: <meta name="languages" content="pl, fr, de"> <meta name="resources" content="../locales/{{lang}}/res.l20n, /shared/{{lang}}/res.l20n"> It looks good to me except the fact that the comma is a valid character to have in URLs. Reading http://www.ietf.org/rfc/rfc3986.txt, may I suggest "|" (the pipe character) as a delimiter of the resources' URLs? Also, should all of this go into bindings/l20n/html.js or bindings/l20n/gaia.js (a new file)?
Attached patch patchSplinter Review
patch with "," replaced by "|" as per stas suggestion
Attachment #749065 - Attachment is obsolete: true
Attachment #751749 - Flags: review?(stas)
Depends on: 874110
Status: NEW → ASSIGNED
Comment on attachment 751749 [details] [diff] [review] patch Review of attachment 751749 [details] [diff] [review]: ----------------------------------------------------------------- ::: bindings/l20n/gaia.js @@ +32,5 @@ > + var metaRes = headNode.querySelector('meta[name="resources"]'); > + if (metaLang && metaRes) { > + initializeManifest({ > + 'languages': metaLang.getAttribute('content').split('|').map(String.trim), > + 'resources': metaRes.getAttribute('content').split('|').map(String.trim) I think I'd prefer the comma for languages and the pipe for resources, but I don't have a strong opinion about this.
Attachment #751749 - Flags: review?(stas) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: