-
Notifications
You must be signed in to change notification settings - Fork 943
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
v7 alpha release #1499
Comments
@rowanwins this is a huge step forward, thank you. Regarding tree shaking, I'm going by memory, but I believe that it didn't work with webpack either. I'll update this with further comments if I figure anything out.
|
Yep confirmed webpack also isn't succesful in tree-shaking, need to do some more digging on the turf config end... |
Hmm so I've done some more digging and it found a few things
So a few options I can think of
Have tried hunting around for similar libraries but the ones I can think of (namely simple-statistics and lodash) don't have any dependencies. Any brilliant ideas @tmcw ? PS This is where the lerna mono-repo stuff was helpful :) |
In case it helps, browsing through rollup's docs they have a suggestion regarding false-positives - to import using
PS - More listed under danger zone on fine-tuning tree-shaking using |
As I mentioned at #1428 (comment) anything to de-group helpers/meta etc. is :+1 in my opinion. Looking forward to being able to just use:
|
@rowanwins If you're still having problems, you might reach out to the OpenLayers devs, they made their v5 work correctly with treeshaking in webpack, rollup and parcel. (v4 had the same problems you seem to be running into). I'll bet they'd be more than willing to share their experiences. As a side note, right now Turf is a full 40% of my current webpack bundle for my application. (I found this issue looking for issues about tree shaking in turf.) I'm extremely excited about the v7 changes. |
Hi @Morgul Thanks for the suggestion. We have actually made a bit of progress on the treeshaking front thanks to some advice from @tmcw so I think we're back on track. Basically the issues primarily relate to some of our 3rd part dependencies so I've been doing some work on upstream libs and inlining others to make them more friendly for us. So stay tuned :) |
Our application size is suffering from jsts. Maybe some help rewriting buffer? Could you point to something? |
@rowanwins Just wondering, what is the status on v7? |
I tried all ways of importing from turf ([email protected], @turf/turf, @turf/boolean-contains), but tree-shaking doesn't work for any of them with Rollup, not even with Rollup dangerous switches. Visualized with rollup-plugin-visualizer, full @turf/meta and @turf/helpers are included, which are probably unnecessary. I'm sorry, but this is a blocker for me for building a lightweight browser library https://github.com/zakjan/leaflet-lasso Until turf supports tree-shaking properly, for browser use I need to look for another library. |
Folks, if you can help out please do, but please don't threadsit on these issues. The status of v7 is readable in the original post of this issue, in the PR linked in the main thread, along with the commits therein. Per those issues, getting everything tree-shakeable is still something that's being worked on, so you shouldn't expect it to work yet: it won't. @zakjan It looks like your library just needs a point in polygon method. You'll find many standalone modules for that by googling or searching npm: for example, point-in-polygon. |
Hi @zakjan & @dpmcmlxxvi There are a few more unresolved issues around the With tree-shaking I think the meta and helper modules these will be relatively low priority as minified they come out very small. I've also released |
I've tried |
Closing, as this ambitious v7 rewrite effort was dropped, and it's PR #1432 has been closed. The effort has been superseded by continued and smaller 6.x minor releases. |
Inline with the suggestions contained within #1428 I've been working on getting a v7 release ready (see #1432)
API Changes
Higher level changes
rollup
Module enhancements
union
,difference
,intersect
by polygon-clipping-
dissolve
has been overhauledTesting
ReferenceError: m is not defined
when buffering linestrings.Outstanding issues
jsts
remains in use is buffer. I'm currently working on a replacement herecoordEach
). For some reason the build is pulling in all of turf rather than just the couple of modules I want (aka tree-shaking doesn't appear to be working...)rollup
as my build tool. I could perhaps investigate using webpack although it would be nice to have turf 'just working' irrespective of build tool choice.Where to find it
What next
cc @stebogit @tmcw
The text was updated successfully, but these errors were encountered: