Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types: Add types to analytics module, fix module syntax #1883

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Feb 6, 2020

The analytics module has been using a commonJS format and has been working "by accident"
because webpack properly translates the import/export syntax.

// moduleA.js
const stuff = {
	thing: 5;
}

module.exports = stuff;

// moduleB.js
import { thing } from 'moduleA'

^^^ that shouldn't work but it has been. This has been resolved in this commit.

Testing

There should be no functional or visual changes in this PR. Some code will likely
change but only in the exports. It may not change once through webpack.

@dmsnell dmsnell requested a review from a team February 6, 2020 05:57
Copy link
Contributor

@belcherj belcherj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some failing tests.

lib/analytics/tracks.ts Show resolved Hide resolved
lib/analytics/tracks.ts Show resolved Hide resolved
@dmsnell dmsnell force-pushed the types/type-analytics branch from c51ef3b to e5fcaa2 Compare February 10, 2020 19:19
Copy link
Contributor

@belcherj belcherj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it

The analytics module has been using a commonJS format and has been working "by accident"
because `webpack` properly translates the import/export syntax.

```js
// moduleA.js
const stuff = {
	thing: 5;
}

module.exports = stuff;

// moduleB.js
import { thing } from 'moduleA'
```

^^^ that shouldn't work but it has been. This has been resolved in this commit.
@dmsnell dmsnell force-pushed the types/type-analytics branch from e5fcaa2 to 24a8296 Compare February 21, 2020 02:20
@dmsnell dmsnell requested review from belcherj and a team February 21, 2020 02:23
@dmsnell
Copy link
Member Author

dmsnell commented Feb 21, 2020

In reviewing this I couldn't find out where the analytics were actually being sent. In fact I couldn't figure this out in production either.

@dmsnell
Copy link
Member Author

dmsnell commented Feb 25, 2020

In a zoom @belcherj helped me find the place where the prefix wasn't being set on account of being a dev build thus preventing analytics calls. We confirmed that analytics are working.

@dmsnell dmsnell merged commit 81a221e into develop Feb 25, 2020
@dmsnell dmsnell deleted the types/type-analytics branch February 25, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants