You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At some point, it was decided to import required functions from @turf/turf, to make sure we only have one version of turf to deal with.
But it turns out the the whole @turf/turf is imported in the webpack bundle, even with webpack's tree shaking activated.
Though @turf/turf is a facade for all turf packages, we cannot import individual packages like @turf/distance for example, as we get a linter error error "@turf/distance" is extraneous n/no-extraneous-import
To investigate
See if latest version of @turf/turf better supports tree shaking and avoids bundling everything
See if it's possible to bypass the linter error and simply import sub-packages directly in our code, while still having our package.json files depend on @turf/turf
Last resort is to go back to individually depending on packages in package.json, but we need to absolutely make sure the package versions are the same everywhere to avoid bundling many versions of the same packages.
The text was updated successfully, but these errors were encountered:
Can we quantize the benefits of going individual stuff?
Not exactly, as I'm not sure how many less packages will be required if we do so. But lower bound: turf-jsts which is used by @turf/buffer which is not used by us takes 5% of the build space in the survey bundle (after reduction of some obvious packages that were taking a lot of space in the survey bundle).
At some point, it was decided to import required functions from @turf/turf, to make sure we only have one version of
turf
to deal with.But it turns out the the whole @turf/turf is imported in the webpack bundle, even with webpack's tree shaking activated.
Though @turf/turf is a facade for all turf packages, we cannot import individual packages like
@turf/distance
for example, as we get a linter errorerror "@turf/distance" is extraneous n/no-extraneous-import
To investigate
The text was updated successfully, but these errors were encountered: