Move messaging.js to NPM package#9547
Merged
chenshay merged 9 commits intoampproject:masterfrom May 31, 2017
Merged
Conversation
dvoytenko
reviewed
May 25, 2017
| */ | ||
|
|
||
| import {Messaging, WindowPortEmulator, parseMessage} from './messaging'; | ||
| import {Messaging, WindowPortEmulator, parseMessage} from 'messaging'; |
Contributor
There was a problem hiding this comment.
Can you explain how "messaging" name here is getting resolved? Also, what will this look like when imported from the "amp-viewer" repo?
Contributor
Author
There was a problem hiding this comment.
it's going to be taken straight from the file itself (not from npm)
Contributor
|
shouldn't we be adding milestones to issues only? |
dvoytenko
suggested changes
May 26, 2017
| return null; | ||
| } | ||
| return /** @type {?Message} */ (tryParseJson(message) || null); | ||
| return /** @type {?Message} */ (JSON.parse(/** @type {string} */ (message))); |
Contributor
There was a problem hiding this comment.
This is a big change - the previous version failed silently. You should probably preserve that. Anyone can send a message and it's not guaranteed to be what we expect. So it's best to shield ourselves and overspam error logs.
| Messaging, | ||
| WindowPortEmulator, | ||
| parseMessage, | ||
| } from '../messaging/messaging.js'; |
Contributor
|
@chenshay Could you pls also reference the PR for |
dvoytenko
approved these changes
May 26, 2017
6ac9dcc to
9b3e477
Compare
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.
close #9528
it is being used here: https://github.com/ampproject/amp-viewer/blob/master/src/amp-viewer-host.js