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

No default export for TypeScript bindings, add Webpack instructions #645

Merged
merged 2 commits into from
Jul 8, 2016

Conversation

benvinegar
Copy link
Contributor

@benvinegar benvinegar commented Jul 7, 2016

Fixes #643, #622

Basically, only SystemJS supported / added compatibility for the "default" export. So I've removed that from the TypeScript definition file, and changed the instructions to indicate how it can be loaded using non-SystemJS loaders.

In Webpack, Raven.js should now be imported like so:

import Raven = require('raven-js');

This looks like CommonJS syntax, but it's TypeScript. More on this syntax from the official TS docs.

Note that the original syntax (import Raven from 'raven-js') still works for use with SystemJS, so this is not a breaking change.

cc @mattrobenolt @mitsuhiko @galuszkak @toepoke


This change is Reviewable


Raven.config('https://public@getsentry.com/1').install();

var options: RavenOptions = {
var options = {
Copy link
Contributor Author

@benvinegar benvinegar Jul 7, 2016

Choose a reason for hiding this comment

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

You cannot explicitly declare things as RavenOptions any more (exporting this depended on default export support), but it will still be type-checked since it is passed as a parameter to Raven.config

@benvinegar
Copy link
Contributor Author

I've verified this works with:

@benvinegar benvinegar changed the title No default export for TypeScript bindings, instructions No default export for TypeScript bindings, add Webpack instructions Jul 7, 2016
@galuszkak
Copy link

Works for me. 👍

@benvinegar benvinegar merged commit 05ebd04 into master Jul 8, 2016
@benvinegar benvinegar deleted the fix-typescript branch July 8, 2016 18:27
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