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

Use transpiled imports from mapbox-gl-style-spec #94

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Aug 2, 2018

This pull request replaces #92.

The downside is that all bundles created from ol-mapbox-style will be larger by 10 kB than with the source imports we previously used.

For create-react-app users, we should consider making that work with ES modules, which it maybe already does in the latest alpha version. See facebook/create-react-app#3889.

That said, I'm not sure if we want to merge this. @bartvde @frankrowe what do you think?

@frankrowe
Copy link
Contributor

Agreed @ahocevar, since CRA is adding support for transpiling node_modules in 2.0, we don't need to merge this.

@theduckylittle
Copy link
Contributor

I've tried this with CRA 2.0 this morning and I don't think it solves the problem directly. Or at least the way Webpack is configured is not doing transpiling the deeper modules.

I'm getting the same syntax errors from that I was getting with CRA 1.x.

@ahocevar
Copy link
Member Author

Can you point me to an example project so I can reproduce the issue and investigate? Thanks!

@bartvde
Copy link
Member

bartvde commented Aug 21, 2018

hey @ahocevar basically the instructions here: https://www.npmjs.com/package/@boundlessgeo/sdk

just make sure to leave out the version numbers for ol-mapbox-style and sdk

@tschaub
Copy link
Member

tschaub commented Aug 21, 2018

I just came across this same issue trying to use ol-mapbox-style with Parcel. It fails to parse the flow syntax in @mapbox/mapbox-gl-style-spec/util/color.js.

@tschaub
Copy link
Member

tschaub commented Aug 21, 2018

Installing [email protected] fixed the issue for me.

@ahocevar
Copy link
Member Author

ahocevar commented Aug 21, 2018

Installing [email protected] fixed the issue for me.

That version uses older versions of the Mapbox dependencies, without support for style expressions.

So, how should we proceed? Do we accept bundle sizes that are 10kB larger than they need to be, and merge this pull request? I tend to say yes now that create-react-app still does not work with this library out of the box, and neither does Parcel. Other opinions?

@bartvde
Copy link
Member

bartvde commented Aug 21, 2018

I also tend to say yes

@bartvde
Copy link
Member

bartvde commented Aug 21, 2018

see also: mapbox/mapbox-gl-js#7105

@bartvde
Copy link
Member

bartvde commented Sep 4, 2018

@ahocevar any objections to merging this one?

@theduckylittle
Copy link
Contributor

At this point it's 10kb vs a lot of broken apps...

@ahocevar
Copy link
Member Author

ahocevar commented Sep 4, 2018

Let‘s do this.

@ahocevar ahocevar merged commit caedf78 into master Sep 4, 2018
@ahocevar ahocevar deleted the cjs-imports-from-mapbox branch September 4, 2018 20:38
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.

5 participants