Skip to content

Support export default (Typescript related)#62

Merged
mourner merged 1 commit intomapbox:masterfrom
DenisCarriere:patch-1
Oct 6, 2017
Merged

Support export default (Typescript related)#62
mourner merged 1 commit intomapbox:masterfrom
DenisCarriere:patch-1

Conversation

@DenisCarriere
Copy link
Copy Markdown
Contributor

@DenisCarriere DenisCarriere commented Oct 6, 2017

Support export default (Typescript related)

Mainly used for Typescript support, other bundlers like Rollup/Babel use some other "magic" to support default exports.

Same thing was done for concaveman & polylabel (PR mapbox/polylabel#10):

An update to the Typescript definition has already been made to reflect this change: DefinitelyTyped/DefinitelyTyped#20348

Rollup "magic" (import default)

import supercluster from 'supercluster'

Gets compile to:

'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var supercluster = _interopDefault(require('supercluster'));

Rollup "no-magic" (import without default)

import * as supercluster from 'supercluster'

Gets compile to:

'use strict';

require('supercluster');

CC: @alex3165 @mourner

@DenisCarriere
Copy link
Copy Markdown
Contributor Author

@mourner 👍 Do you mind if I send send more PR's to all your MANY other repos?

@mourner
Copy link
Copy Markdown
Member

mourner commented Oct 6, 2017

@DenisCarriere yeah, no harm from a change like this :)

@mourner mourner merged commit 0be0042 into mapbox:master Oct 6, 2017
@DenisCarriere
Copy link
Copy Markdown
Contributor Author

DenisCarriere commented Oct 6, 2017

@mourner Sounds good! Should I bump the package.json version while I'm at it? That way you just need to npm publish once merged

@DenisCarriere DenisCarriere deleted the patch-1 branch October 6, 2017 13:34
@mourner
Copy link
Copy Markdown
Member

mourner commented Oct 6, 2017

@DenisCarriere no, it's better for me to do npm version because it also creates a tag.

@DenisCarriere
Copy link
Copy Markdown
Contributor Author

Oh gotcha! 👍 (maybe I should do the same when I publish my repos 😄 )

@DenisCarriere
Copy link
Copy Markdown
Contributor Author

Expect ~5-10 PR's

DenisCarriere added a commit to DenisCarriere/tinyqueue that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/rbush-knn that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/kdbush that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/earcut that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/delaunator that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/linematch that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/lineclip that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/simplify-js that referenced this pull request Oct 6, 2017
mourner pushed a commit to mourner/kdbush that referenced this pull request Oct 6, 2017
mourner pushed a commit to mourner/tinyqueue that referenced this pull request Oct 6, 2017
mourner pushed a commit to mourner/simplify-js that referenced this pull request Oct 6, 2017
DenisCarriere added a commit to DenisCarriere/tiny-sdf that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/delaunator that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/lineclip that referenced this pull request Oct 6, 2017
@DenisCarriere
Copy link
Copy Markdown
Contributor Author

@mourner Should be done now for the export default PR's, I've linked them all to this PR so we track them all here.

Thanks for the quick merges 👍

mourner pushed a commit to mourner/rbush-knn that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/tiny-sdf that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/cheap-ruler that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/linematch that referenced this pull request Oct 6, 2017
mourner pushed a commit to mapbox/earcut that referenced this pull request Oct 6, 2017
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