Skip to content

Entry Points #2537

@DennisSmolek

Description

@DennisSmolek

This is a wrapper around the others

(Tag other issues here)

The idea is

import { Box } from '@react-three-fiber/drei`; // works fine, masks to import from gl (for now), file is in core
import { Box } from '@react-three-fiber/drei/gl`; // same thing but imported directly
import { Box } from '@react-three-fiber/drei/webgpu`; // works fine, file lives in core
import { Terrrain } from @rect-three-fiber/drei/webgu // webgpu only component

For now, importing from Drei will seem the same for packages as WebGLRenderer is and will be the primary renderer for a long while.

Components that can support both will live in a shared location structure wise, but import wise we are going to do a hard split down the WebGLRenderer and WebGPURenderer lines. This is because touching ANYTHING in the main three setup will import three.module.js giving us a few extra mb in imports.

So the idea is, if you use Drei with webgl you can keep importing as you have been (for now) but we will eventually push people to import from drei/gl and that import path will include core elements as it should.

If you use Drei with webgpu you use drei/webgpu which also exports core, but also the correct three module paths and any webgpu only components.

(This is a first draft issue, ill expand later)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions