Coder Social home page Coder Social logo

Comments (6)

donmccurdy avatar donmccurdy commented on May 17, 2024 4

but nothing inside, for instance, examples/jsm/libs can even be used

This claim is incorrect. Static resources cannot be fetched from node_modules in most cases, but JavaScript modules certainly can. Any use of KTX2Loader is getting dependencies this way:

} from '../libs/ktx-parse.module.js';
import { ZSTDDecoder } from '../libs/zstddec.module.js';

If I create a new react+next.js-based project with three.js, my dependencies could easily look something like this:

next_deps

That's obviously not great, but three.js is not a particularly bad offender on the list either. Is this such a major issue that we'd need to throw all of examples/jsm/libs out?

I understand the R3F community is using three-stdlib rather than these files, and perhaps a more complete proposal could be made to change how we're structuring the project, but I don't feel this issue currently describes motivating reasons for such a change.

from three.js.

marcofugaro avatar marcofugaro commented on May 17, 2024 1

I believe we can do something similar to the webgl_geometry_csg example, for the examples on the website we can use import maps pointing to unpkg.com, whereas on npm we could declare the packages as optional peerDependencies.

However this comes with the burden of having to tell the user to install a specific version of fflate when using the FBXLoader for example. What's your view on this?

from three.js.

mrdoob avatar mrdoob commented on May 17, 2024 1

Does anyone want to do a treemap to illustrate what contributes to these 23mb?

from three.js.

LeviPesin avatar LeviPesin commented on May 17, 2024

However this comes with the burden of having to tell the user to install a specific version of fflate when using the FBXLoader for example. What's your view on this?

I think that users already do something like this for packages like react-three-fiber, so it shouldn't be too much of an issue?

from three.js.

drcmda avatar drcmda commented on May 17, 2024

the javascript files can, but what's the point when each and every one of them is on npm, a package should avoid inlining dependencies. but the binaries cannot be used in a meaningful way, they are there for nothing.

as for stdlib, three + jsm/examples is being present always, and in larger projects it contributes to install times and slow tooling.

std declares all dependencies properly
https://github.com/pmndrs/three-stdlib/blob/main/package.json#L36-L48 but it can't help the weight that is caused by three.

from three.js.

Mugen87 avatar Mugen87 commented on May 17, 2024

Is this such a major issue that we'd need to throw all of examples/jsm/libs out?

Definitely no.

perhaps a more complete proposal could be made to change how we're structuring the project, but I don't feel this issue currently describes motivating reasons for such a change.

Agreed.

from three.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.