{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/9876","repository_url":"https://api.github.com/repos/ampproject/amphtml","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/9876/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/9876/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/9876/events","html_url":"https://github.com/ampproject/amphtml/issues/9876","id":235611617,"node_id":"MDU6SXNzdWUyMzU2MTE2MTc=","number":9876,"title":"Allow AMP to be compiled with full property obfuscation","user":{"login":"cramforce","id":89679,"node_id":"MDQ6VXNlcjg5Njc5","avatar_url":"https://avatars2.githubusercontent.com/u/89679?v=4","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"labels":[{"id":284925157,"node_id":"MDU6TGFiZWwyODQ5MjUxNTc=","url":"https://api.github.com/repos/ampproject/amphtml/labels/Category:%20Tooling","name":"Category: Tooling","color":"1d76db","default":false},{"id":301403423,"node_id":"MDU6TGFiZWwzMDE0MDM0MjM=","url":"https://api.github.com/repos/ampproject/amphtml/labels/Related%20to:%20Performance","name":"Related to: Performance","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"cramforce","id":89679,"node_id":"MDQ6VXNlcjg5Njc5","avatar_url":"https://avatars2.githubusercontent.com/u/89679?v=4","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"assignees":[{"login":"cramforce","id":89679,"node_id":"MDQ6VXNlcjg5Njc5","avatar_url":"https://avatars2.githubusercontent.com/u/89679?v=4","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ampproject/amphtml/milestones/20","html_url":"https://github.com/ampproject/amphtml/milestone/20","labels_url":"https://api.github.com/repos/ampproject/amphtml/milestones/20/labels","id":1884542,"node_id":"MDk6TWlsZXN0b25lMTg4NDU0Mg==","number":20,"title":"Pending Triage","description":"These issues need to get put into another milestone. They should be assigned to the person who can best decide the appropriate milestone. Optionally, the issue can then be assigned to the most likely implementer.","creator":{"login":"rudygalfi","id":3888212,"node_id":"MDQ6VXNlcjM4ODgyMTI=","avatar_url":"https://avatars3.githubusercontent.com/u/3888212?v=4","gravatar_id":"","url":"https://api.github.com/users/rudygalfi","html_url":"https://github.com/rudygalfi","followers_url":"https://api.github.com/users/rudygalfi/followers","following_url":"https://api.github.com/users/rudygalfi/following{/other_user}","gists_url":"https://api.github.com/users/rudygalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/rudygalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudygalfi/subscriptions","organizations_url":"https://api.github.com/users/rudygalfi/orgs","repos_url":"https://api.github.com/users/rudygalfi/repos","events_url":"https://api.github.com/users/rudygalfi/events{/privacy}","received_events_url":"https://api.github.com/users/rudygalfi/received_events","type":"User","site_admin":false},"open_issues":184,"closed_issues":876,"state":"open","created_at":"2016-07-14T23:13:22Z","updated_at":"2018-06-05T13:36:37Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2017-06-13T16:23:04Z","updated_at":"2018-06-05T14:27:33Z","closed_at":null,"author_association":"MEMBER","body":"@erwinmombay and me are preparing the AMP code base for more aggressive optimizations in the closure compiler.\r\n\r\nRight now only private properties are obfuscated. Soon, among other things, all properties will be obfuscated unless we stop them.\r\n\r\nThat means stuff like\r\n\r\n`foo.mutateElement` might become a.a;\r\n\r\nsaving lots of bytes :)\r\n\r\nHowever, it also means that if you so something like\r\n\r\n`JSON.stringify({type: 'abc'})`\r\n\r\nthen `type` might be obfuscated, but the party that parsrs the json (Say youtube) might have had no idea and break.\r\n\r\nFor this reason you must now always quote properties like {'type': 'abc'} or foo['type'] when accessing properties that come from an external source. That is unless you created an \"Extern\" for the type (beyond the scope of this email).\r\n\r\nI submitted a bunch of PRs\r\n#9876, #9960\r\n\r\nthat use the type system to enforce y'all doing this right as much as possible.\r\n\r\nIt might, however, miss some stuff. E.g. json['foo'].bar is not an error, but would break. You have to write json['foo']['bar']\r\nThere might be more cases that the typing doesn't catch. If you find a case where you think a property should be quoted, but the compiler doesn't yell at you, please ping me.\r\n\r\nThe cases where we need to be careful are:\r\n- JSON.parse, stringify\r\n- postMessage and the message event\r\n- fetch messages and responses\r\n- parsing or generating query strings\r\n- polyfilling APIs (make sure to case polyfills to the defined extern type)\r\n- did I missing anything? Please comment on https://github.com/ampproject/amphtml/issues/9876\r\n\r\nTasks:\r\n\r\n- [x] Audit all calls to `JSON.parse`\r\n- [x] Audit all calls to `JSON.stringify`\r\n- [x] Change types of `sendMessage` and friends.\r\n- [x] fetch body\r\n- [x] `parseQueryString`\r\n- [x] Polyfills need to use correct externed types.\r\n- [x] Tighten type of `event.data` for `Message` events.\r\n- [x] Audit amp-analytics config\r\n- [x] Audit amp-social share config\r\n- [x] `dataset` and `classlist`\r\n"},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/394730333","html_url":"https://github.com/ampproject/amphtml/issues/9876#issuecomment-394730333","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/9876","id":394730333,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDczMDMzMw==","user":{"login":"ampprojectbot","id":23269078,"node_id":"MDQ6VXNlcjIzMjY5MDc4","avatar_url":"https://avatars3.githubusercontent.com/u/23269078?v=4","gravatar_id":"","url":"https://api.github.com/users/ampprojectbot","html_url":"https://github.com/ampprojectbot","followers_url":"https://api.github.com/users/ampprojectbot/followers","following_url":"https://api.github.com/users/ampprojectbot/following{/other_user}","gists_url":"https://api.github.com/users/ampprojectbot/gists{/gist_id}","starred_url":"https://api.github.com/users/ampprojectbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampprojectbot/subscriptions","organizations_url":"https://api.github.com/users/ampprojectbot/orgs","repos_url":"https://api.github.com/users/ampprojectbot/repos","events_url":"https://api.github.com/users/ampprojectbot/events{/privacy}","received_events_url":"https://api.github.com/users/ampprojectbot/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T14:27:33Z","updated_at":"2018-06-05T14:27:33Z","author_association":"COLLABORATOR","body":"This issue seems to be in  Pending Triage for awhile. @cramforce Please triage this to an appropriate milestone."}}
{"actor":{"display_login":"ampprojectbot"}}