Giter Club home page Giter Club logo

three-stdlib's Introduction

three-stdlib

Version Downloads Twitter Discord release

Stand-alone version of threejs/examples/jsm written in Typescript & built for ESM & CJS.

Basic usage

npm install three-stdlib
// Export collection
import * as STDLIB from 'three-stdlib'
// Flatbundle
import { OrbitControls, ... } from 'three-stdlib'

Problem

three/examples are usually regarded as something that you copy/paste into your project and adapt to your needs. That's not how people use it, and this has caused numerous issues in the past.

Solution

  • A build system for ESM and CJS, compatible with browser, workers, and Node
  • Class based, optimized for tree-shaking, no globals, exports instead of collections
  • Typesafety with simple annotation-like types
  • SemVer and NPM managed dependencies

But most importantly, allowing more people that use and rely on these primitives to hold a little stake, and to share the weight of maintaining it.

How to Contribute

  1. Fork and clone the repo
  2. Run yarn install to install dependencies
  3. Create a branch for your PR with `git checkout -b pr-type/issue-number-your-branch-name beta
  4. Let's get cooking! ๐Ÿ‘จ๐Ÿปโ€๐Ÿณ๐Ÿฅ“

Commit Guidelines

Be sure your commit messages follow this specification: https://conventionalcommits.org/en/v1.0.0-beta.4

Publishing

We use semantic-release-action to deploy the package. Because of this only certain commits will trigger the action of creating a release:

  • chore will not release a new version
  • fix: will create a 0.0.x version
  • feat: will create a 0.x.0 version
  • BREAKING CHANGE: will create a x.0.0 version

three-stdlib's People

Contributors

abernier avatar alaricbaraou avatar bjornstar avatar codyjasonbennett avatar disambiguator avatar drcmda avatar dylantackoor avatar garrlker avatar giulioz avatar gsimone avatar hasparus avatar haywirez avatar joshuaellis avatar kousun12 avatar krispya avatar marlon360 avatar methuselah96 avatar mike-dax avatar nicolasrannou avatar patrick-van-halm-360fabriek avatar renaudrohlinger avatar saitonakamura avatar sea-dh1 avatar semantic-release-bot avatar servinlp avatar shakofarhad avatar shuta13 avatar sniok avatar susiwen8 avatar vorth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

three-stdlib's Issues

[TS1] Move drei related dependencies to TS

Describe the feature you'd like:

Move imports in drei that are not related to #4 over to TS

  • Simplex Noise
  • HorizontalBlurShader
  • VerticalBlurShader
  • CurveModifier
  • GammaCorrectionShader
  • LineGeometry
  • LineMaterial
  • Line2
  • EdgeSplitModifier
  • SimplifyModifier
  • TessellateModifier
  • Sky
  • RGBELoader

Line2 RuntimeError due to LineSegmentGeometry

  • three version: 0.126.0
  • three-stdlib version: 1.0.1

Problem description:

Line2 causes runtime error:

TypeError: _LineSegmentsGeometry_js__WEBPACK_IMPORTED_MODULE_1__.LineSegmentsGeometry.prototype.setPositions is undefined

This is because the constructor tries to instantiate a LineGeometry, which tries to call parent method setPositions here.

LineSegmentsGeometry does not end up having this property because we use arrow functions to define setPositions in LineGeometry here. Arrow functions in classes compile to properties on the instance of a class, instead of on the prototype itself.

Suggested solution:

Move all methods in LineSegmentsGeometry to use function syntax. This will solve this initial bug, but part of me thinks this issue will crop up again and there's a more sophisticated approach to avoiding it in the future.

preventDefault in TrackballControls prevents click events on dom element

  • three version: 0.132.2
  • three-stdlib version: 2.4.0

Problem description:

touchstart and touchend event listeners use preventDefault() in some camera controls, such as TrackballControls, this prevents any further mouse events from firing. When using TrackballControls and GizmoViewcube together from @react-three/drei, GizmoViewcube is not clickable because click events are prevented in TrackballControls. I wonder why preventDefault() is necessary in such listeners, or is there a solution for such situation.

Relevant code:

Use mobile or toggle mobile mode on Chrome DevTools.

https://codesandbox.io/s/lingering-http-d22qu

Suggested solution:

Remove preventDefault() in touchstart and touchend listeners within such camera controls. Using preventDefault() in touchmove listener should be enough for disabling scroll behavior on mobile.

What is the relationship between this lib with drei

What is your question:

Currently to use drei in next.js I need to do:

const withTM = require("next-transpile-modules")([
  "three/examples/jsm/lines/LineGeometry",
  "@react-three/drei",
])

Would this library work with drei somehow and eliminate the needs for "next-transpile-modules"?

Thanks.

React-Three-Fiber break's with Three 0.128.0

Hi,

I tried to load a GLTF and OBJ File into a Scene with the actual versions of three and RTF.
Unfortunately RTF break's with the newest version of ThreeJS (0.128.0)

Easy to reproduce with

Errors:

  • TypeError: Class constructor CompressedTextureLoader cannot be invoked without 'new'
  • TypeError: Class constructor Loader cannot be invoked without 'new'

Just change Three version to 0.128.0 and the error will appear in console.

Kind regards

USDZExporter exports invalid USDZ file

  • three version: 0.134.0
  • three-stdlib version: 2.5.9

Problem description:

The USDZExporter is not working correctly when exporting materials.
The exported model.usda file is not valid, because a curly bracket is in the wrong line.

Relevant code:

That's how I call the exporter:

const exporter = new USDZExporter();
const arraybuffer = await exporter.parse(scene);
const blob = new Blob([arraybuffer], {
  type: "application/octet-stream",
});

Suggested solution:

return `
{
def Material "Material_${material.id}"
def Shader "PreviewSurface"
{
uniform token info:id = "UsdPreviewSurface"
${inputs.join('\n')}
int inputs:useSpecularWorkflow = 0
token outputs:surface
}
token outputs:surface.connect = </Materials/Material_${material.id}/PreviewSurface.outputs:surface>
token inputs:frame:stPrimvarName = "st"
def Shader "uvReader_st"
{
uniform token info:id = "UsdPrimvarReader_float2"
token inputs:varname.connect = </Materials/Material_${material.id}.inputs:frame:stPrimvarName>
float2 inputs:fallback = (0.0, 0.0)
float2 outputs:result
}
${samplers.join('\n')}
}
`

Line 386 and 387 need to be switched.

This is the current implementation in three.js:

https://github.com/mrdoob/three.js/blob/9c57b2e117e7e615cf8c9645fad90e4ad8ce6757/examples/js/exporters/USDZExporter.js#L460-L484

Consider adding `@babel/runtime` as a peer dependency

Describe the feature you'd like:

Consider adding @babel/runtime as a peer dependency. After installing the lib for the first time, and calling new OrbitControls, I received an error flagging that this dependency was required.

The automated release is failing ๐Ÿšจ

๐Ÿšจ The automated release from the alpha branch failed. ๐Ÿšจ

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iโ€™m sure you can resolve this ๐Ÿ’ช.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the alpha branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those donโ€™t help, or if this issue is reporting something you think isnโ€™t right, you can always ask the humans behind semantic-release.


Missing package.json file.

A package.json file at the root of your project is required to release on npm.

Please follow the npm guideline to create a valid package.json file.


Good luck with your project โœจ

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

@webgpu/glslang imports fs by default

  • three version: n/a
  • three-stdlib version: 1.0.0

Problem description:

We currently import the package @webgpu/glslang, which by default imports the node version of it's library which then requires fs. If you change it to a the web version it then has issues with a token, which makes me think there's an issue with their build process for js.

Relevant code:

See a recent fail in vercel deployment.

Suggested solution:

Not sure, can we compile that node_module on our build process so it works correctly...?

Line Material is broken

  • three version: 126
  • three-stdlib version: current

Problem description:

Line Material is badly broken

Relevant code:

Check the storybook on alpha

Suggested solution:

[TS2] Loaders

Suggested implementation:

  • low/IFFParser
  • lwo/LWO2Parser
  • lwo/LWO3Parser
  • 3DMLoader
  • 3MFLoader
  • AMFLoader
  • AssimpLoader
  • BasisTextureLoader
  • BVHLoader
  • ColladaLoader
  • DDSLoader
  • DRACOLoader
  • EXRLoader
  • FBXLoader
  • GCodeLoader
  • GLTFLoader
  • HRDCubeTextureLoader
  • KMZLoader
  • LDrawLoader
  • LottieLoader
  • LUT3dlLoader
  • LUTCubeLoader
  • LWOLoader
  • MD2Loader
  • MDDLoader
  • MMDLoader
  • MTLLoader
  • NodeMaterialLoader
  • NRRDLoader
  • OBJLoader
  • PCDLoader
  • PDBLoader
  • PLYLoader
  • PRWMLoader
  • PVRLoader
  • RGBELoader
  • RGBMLoader
  • STLLoader
  • SVGLoader
  • RDSLoader
  • TGALoader
  • TiltLoader
  • TTFLoader
  • VOXLoader
  • VRMLoader
  • VTKLoader
  • XLoader
  • XYZLoader

How to rotate camera of orbit controls?

I see a setAzimuthalAngle and a setPolarAngle implementation in OrbitControls but I can't understand how to use it. I passed degrees and radians but nothing happens.

My goal is to rotate the orbit controls some radians after the component mounted.

Suggestion: Add all the files under `threejs/examples/jsm/libs` to `three-stdlib/src/libs`

Describe the feature you'd like:

I would like to be able to manage all files in three.js/examples/jsm/libs with three-stdlib.

For now, only meshopt_decoder.module.js is copied from three.js/examples/jsm/libs to three-stdlib as MeshoptDecorder.js ( https://github.com/pmndrs/three-stdlib/blob/main/src/libs/MeshoptDecoder.js ), but other files should be moved to three-stdlib as well. By moving other files to three-stdlib and rewriting them into TypeScript if possible, I think three-stdlib can better support people using three.js/examples.

Suggested implementation:

Follow the steps below

  • copy from three.js/examples/jsm/libs to three-stdlib/src/libs
  • move three-stdlib/src/libs/*.module.js into three-stdlib/src/libs/*.js
  • (if possible) move three-stdlib/src/libs/*.js into three-stdlib/src/libs/*.ts

three-stdlib/index.cjs.js - Illegal variable reference before declaration: i

  • three version: 0.129.0
  • three-stdlib version: 2.1.0

Problem description:

When I try to get a production build with shadow-cljs (It uses Google Closure library), I get the following error:

Closure compilation failed with 2 errors
--- node_modules/three-stdlib/index.cjs.js:2
Illegal variable reference before declaration: i
--- node_modules/three-stdlib/index.cjs.js:2
Illegal variable reference before declaration: t

If I don't require @react-three/drei library in the namespace/class/my project everything seems fine, I assume some code in the library is broken/invalid, but Webpack is able to ignore it and process it.

Here is the discussion with the author of shadow-cljs:
Screen Shot 2021-06-17 at 00 46 21

[TS1] Move Controls to TS

  • Camera Controls
  • DeviceOrientationControls
  • DragControls
  • FirstPersonControls
  • FlyControls
  • OrbitControls
  • PointerLockControls
  • TrackballControls
  • TransformControls

No more mouseDown event in TransformControls

  • three version: 0.132.2
  • three-stdlib version: 2.4.0

Problem description:

mouseDown event is no more triggered in TransformControls, probably since f59f1e2

Relevant code:

this._dragging = true
this.mouseDownEvent.type = this._mode
this.dispatchEvent(this.mouseDownEvent)

Suggested solution:

this.mouseDownEvent.type = this._mode 

should be

this.mouseDownEvent.mode = this._mode 

Otherwise the dispatchEvent will trigger a 'translate'|'scale'|'rotate' event instead of mouseDown event

As shown on the three.js current master branch:
https://github.com/mrdoob/three.js/blob/e62b253081438c030d6af1ee3c3346a89124f277/examples/jsm/controls/TransformControls.js#L278-L282

TransformControls partially broken

  • three version: 0.127.0
  • three-stdlib version: ^1.1.4

Problem description:

TransformControls events do not fire and control does not respond to changes in the mode property. Originally reported in pmndrs/drei#355

  • Storybook implementation appears that it is intended to disable OrbitControls when the TransformControls is dragged, but this is not working (tested in Safari 14 + Chrome 89). As the transform is dragged, both it and the camera move
  • Changing the knobs for TransformControlsLockSt does not make any change in the appearance or function of the TransformControl, e.g. changing from translation to rotation leaves TransformControl in 'translate' mode.

Relevant code:

Try the stories here:

https://drei.pmnd.rs/?path=/story/controls-transformcontrols--transform-controls-lock-st

This drop in JS replacement that references three/examples/jsm/controls/TransformControls instead of three-stdlib appears to work as expected.

import * as React from 'react'
import { useThree } from '@react-three/fiber'
import { TransformControls as TransformControlsImpl } from 'three/examples/jsm/controls/TransformControls'
import pick from 'lodash.pick'
import omit from 'lodash.omit'

export const PatchedTransformControls = React.forwardRef(({ children, ...props }, ref) => {
  const transformOnlyPropNames = [
    'enabled',
    'axis',
    'mode',
    'translationSnap',
    'rotationSnap',
    'scaleSnap',
    'space',
    'size',
    'dragging',
    'showX',
    'showY',
    'showZ',
  ]

  const { camera, ...rest } = props
  const transformProps = pick(rest, transformOnlyPropNames)
  const objectProps = omit(rest, transformOnlyPropNames)

  const gl = useThree(({ gl }) => gl)
  const defaultCamera = useThree(({ camera }) => camera)
  const invalidate = useThree(({ invalidate }) => invalidate)

  const explCamera = camera || defaultCamera

  const [controls] = React.useState(() => new TransformControlsImpl(explCamera, gl.domElement))

  const group = React.useRef()
  React.useLayoutEffect(() => void controls?.attach(group.current), [children, controls])

  React.useEffect(() => {
    controls?.addEventListener?.('change', invalidate)
    return () => controls?.removeEventListener?.('change', invalidate)
  }, [controls, invalidate])

  return controls ? (
    <>
      <primitive ref={ref} dispose={undefined} object={controls} {...transformProps} />
      <group ref={group} {...objectProps}>
        {children}
      </group>
    </>
  ) : null
})

Suggested solution:

No idea of the root cause as yet, but will update if I discover more.

Storybook Broken

When loading the Storybook

the page doesn't load.

Console says:

619.4a46c130.iframe.bundle.js:2 Uncaught TypeError: esm.ConfigApi is not a constructor
    at start (619.4a46c130.iframe.bundle.js:2:200791)
    at Object../node_modules/@storybook/html/dist/esm/client/preview/index.js (619.4a46c130.iframe.bundle.js:2:148182)
    at __webpack_require__ (runtime~main.536d0841.iframe.bundle.js:1:357)
    at Module../node_modules/@storybook/html/dist/esm/client/index.js (619.4a46c130.iframe.bundle.js:2:144149)
    at __webpack_require__ (runtime~main.536d0841.iframe.bundle.js:1:357)
    at Object../storybook-init-framework-entry.js (main.a87180a5.iframe.bundle.js:1:171140)
    at __webpack_require__ (runtime~main.536d0841.iframe.bundle.js:1:357)
    at __webpack_exec__ (main.a87180a5.iframe.bundle.js:1:171304)
    at main.a87180a5.iframe.bundle.js:1:171566
    at Function.__webpack_require__.O (runtime~main.536d0841.iframe.bundle.js:1:963)
    ```

Error using VertexTangentsHelper, doesn't occur in three/examples

  • three version: r129
  • three-stdlib version: 2.0.5

Problem description:

VertexTangentsHelper plugged into drei's useHelper causes an error, while the corresponding helpers in three/examples work as expected

Relevant code:

https://codesandbox.io/s/oiix2

Commenting out the three/examples import and uncommenting the three-stdlib one produces the error:

ReferenceError
Must call super constructor in derived class before accessing 'this' or returning from derived constructor

Suggested solution:

null

It's possible that this is actually an issue with useHelper but I expect that three-stdlib should work the same three/examples.

OrbitControls saveState differ from Three's

  • three version: r127
  • three-stdlib version: v1.2.4

Problem description:

There is an inconsistency regarding the OrbitControls method saveState and how it behaves. In Three, the camera.zoom is saved while saving the state of the controls, regardless if the camera is a perspective one or orthographic:
https://github.com/mrdoob/three.js/blob/3d59a07b32394c1a0d57c8558775d0ba3a54d7da/examples/jsm/controls/OrbitControls.js#L123-L129

In this library this is not the case any longer (it used to be but was changed in 938045a). Now it is only saved for perspective cameras.

Due to the camera zoom of orthographic cameras no longer being saved, resetting the OrbitControls with the reset method will not properly reset the camera to previous state.

Relevant code:

this.saveState = (): void => {
scope.target0.copy(scope.target)
scope.position0.copy(scope.object.position)
scope.zoom0 = scope.object instanceof PerspectiveCamera ? scope.object.zoom : 1
}

Suggested solution:

If this was not done intentionally due to some weird behavior I would suggest to just revert that specific line, making it possible to properly save the state of orthographic cameras.

If it was done intentionally, it would be nice with a comment explaining why ๐Ÿ‘

GLTFReference type out of date

  • three version: 0.136.0
  • three-stdlib version: 2.6.4

Problem description:

The current GLTFReference type is out of date since version 2.6.4 where loaders were updated.

Relevant code:

const reference = parser.associations.get(object.material) 

if (reference?.materials) {
  // TS error: Property 'materials' does not exist on type 'GLTFReference'
  object.material = copiedMaterials[reference.materials]
  object.material.needsUpdate = true
}

Suggested solution:

I have fixed this temporarily like this:

interface GlTFMaterialReference {
  materials: number
}

const reference = parser.associations.get(object.material) as
        | GlTFMaterialReference
        | undefined

I think to handle this type properly in the library it will need something like generics because the type will change depending on what is passed to parser.associations.get

Extra notes

The type currently looks like this, which is now out of date:

// GLTFLoader.d.ts
export interface GLTFReference {
    type: 'materials' | 'nodes' | 'textures';
    index: number;
}

[TS] โ€“ extract missing .d.ts files from three-ts-types on build

Describe the feature you'd like:

We don't get type safety when using this library because there aren't many TS files in the repo (yet). So after a discussion in Discord, a good solution, while we move over, is to extract the .d.ts files from three-ts-types and include them in the project during the build process.

Why don't you just include the files and commit?

Double the workload, we don't want to have to maintain them in tangent.

What happens if they're different?

We'll have to convert those files to TS and I expect the people who have the problem to do so, community spirit and that โญ

๐Ÿ”ฎ V1 Release

What do we want to achieve & have done for the v1 release?

For me, it's the TS1 implementation & a better readme ๐Ÿ˜‰

ArcballControls throws `Uncaught TypeError: navigator.clipboard.readText is not a function`

  • three version: 0.136.0
  • @react-three/drei version: 8.3.1
  • three-stdlib version: 2.6.4
  • Firefox version: 95.0.2

Problem description:

ArcballControls has a functionality to copy/paste state using Ctrl-C/V.

I have another component that listens to document.addEventListener('paste' but while using Ctrl-V. I get this error.

Uncaught TypeError: navigator.clipboard.readText is not a function
    pasteState https://threejs.org/examples/jsm/controls/ArcballControls.js:2568
    onKeyDown https://threejs.org/examples/misc_controls_arcball.html:255
ArcballControls.js:2568:23

Color disappears from TransformControls after first interaction

  • three version: 0.128.0
  • @react-three/fiber version: 6.0.19
  • @react-three/drei version: 4.3.3
  • node version: v12.21.0
  • npm (or yarn) version: 7.11.2

Problem description:

Currently, TransformControls start with a color-coded set of axes that can be clicked and dragged. However, after the first mouse interaction (either hover or click/drag), the color disappears on the interacted axis, and the other axes disappear.

Relevant code:

This behavior is currently visible in the storybook for TransformControls.

Suggested solution:

This may actually be an issue with three-stdlib.

[TS2] Exporters

Suggested implementation:

  • ColladaExporter
  • DRACOExporter
  • GLTFExporter
  • MMDExporter
  • OBJExporter
  • PLYExporter
  • STLExporter
  • USDZExporter

Colors of TransformControls' Axes Not Rendering Correctly After Mouse Hover

  • three version: 0.128.0
  • @react-three/fiber version: 6.0.19
  • @react-three/drei version: 4.3.3
  • node version: 15.10.0
  • npm version: 7.5.3

Problem description:

Colors of TransformControls' axes become white after mouse hover.
Their original color (red, green, and blue) are gone, which differs from the example shows in the official Three.js documentation.

Before mouse hover:
Screen Shot 2021-05-21 at 11 10 02 AM

After mouse hover:
Screen Shot 2021-05-21 at 11 09 45 AM

Relevant code:

Not sure what causes this bug, but you can find it here

make controls programmatically controllable

probably one of the most requested features for controls, for instance orbit:

orbit.pan(x, y)
orbit.zoom(level)
orbit.rotate(delta, phi)

currently controls are sealed and can only be controlled by pointer input, which also creates a problem bc once you have controls, nothing else is allowed to move the camera bc it would cancel movement out.

Failed to Compile due to Module parse failed: Unexpected token

  • three version: ^0.132.2
  • three-stdlib version: ^2.4.1

Problem description:

When I set up a new project and run it. The compiler gives this error:

./node_modules/three-stdlib/exporters/ColladaExporter.js 127:20
Module parse failed: Unexpected token (127:20)
File was processed with these loaders:

  • ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.
    |
    | return res;
    > }).join('\n')) ?? '';
    | } // Convert an image into a png format for saving
    |

Suggested solution:

i tried to install esm later but it dosen't work.

LineMaterial should support THREE.Color

  • three-stdlib version: 1.0.2

Problem description:

LineMaterial currently only supports being used with a number, instead of a THREE.Color type, as specified in three-ts-types.

Suggested solution:

I think this is as simple of a fix as adding Color as a return type on https://github.com/three-types/three-ts-types/blob/master/types/three/examples/jsm/lines/LineMaterial.d.ts#L16 and removing line https://github.com/three-types/three-ts-types/blob/master/types/three/examples/jsm/lines/LineMaterial.d.ts#L16.

I'd test it but I can't seem to get storybook working locally.

[TS2] PostProcessing

Suggested implementation:

  • AdaptiveToneMappingPass
  • AfterImagePass
  • BloomPass
  • BokehPass
  • ClearPass
  • CubeTexturePass
  • DotScreenPass
  • EffectComposer
  • FilmPass
  • GlitchPass
  • HalftonePass
  • LUTPass
  • MaskPass
  • OutlinePass
  • Pass
  • SAOPass
  • SavePass
  • ShaderPass
  • SMAAPass
  • SSAARenderPass
  • SSAOPass
  • SSRPass
  • TAARenderPass
  • TexturePass
  • UnrealBloomPass

Question: How to manage discrepancies with three types?

I'm noticing that these modules pull from @types/three, currently maintained parallel with three.

My concern is managing discrepancies between this repository and three's and keeping the shared types in sync.

To circumvent this, I see two options, although exhaustive:

  • track and mirror changes in three, likely via bot magic (or vice versa)
  • add self-contained types/doc to the repository

What are your thoughts on this? Is there something internal going on that makes this a non-issue?

The automated release is failing ๐Ÿšจ

๐Ÿšจ The automated release from the main branch failed. ๐Ÿšจ

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iโ€™m sure you can resolve this ๐Ÿ’ช.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those donโ€™t help, or if this issue is reporting something you think isnโ€™t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project โœจ

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

CharsetEncoder of CommonJS error on Importing to Codepen

  • three version: ^0.128.0
  • three-stdlib version: ^2.4.0

Problem description:

Importing the package in a Codepen project outputs the error below and breaks the project. Tried from different CDN urls however got the same result. I suspect this is an issue with the package however wanted to note here since a project depending on this package can't be run on the platform.

Uncaught TypeError: Cannot destructure property 'CharsetEncoder' of '__commonjs_module0' as it is null.
    at three-stdlib.js:5

Relevant code:

import * as threeStdlib from "https://cdn.skypack.dev/[email protected]";

const { useState } = React;

const App = () => (
  <h2>Hello World!</h2>
);

ReactDOM.render(<App />, document.getElementById('app'));

Vite can't handle stdlib

9:32:41 AM [vite] new dependencies found: three-stdlib, updating...
 > node_modules/three-stdlib/loaders/RGBELoader.js:1:72: error: No matching export for import 
"DataUtils"
    1 โ”‚ ...ByteType, HalfFloatType, FloatType, DataUtils, RGBFormat, RGBEFormat, LinearEnco...
      โ•ต                                        ~~~~~~~~~

 > node_modules/three-stdlib/loaders/EXRLoader.js:1:155: error: No matching export for import 
"DataUtils"
    1 โ”‚ ...inearEncoding, LinearFilter, RGBEEncoding, NearestFilter, DataUtils } from 'three';
      โ•ต                                                              ~~~~~~~~~

 > node_modules/three-stdlib/lights/RectAreaLightUniformsLib.js:1:119: error: No matching expo
rt for import "DataUtils"
    1 โ”‚ ...EdgeWrapping, LinearFilter, NearestFilter, DataUtils, HalfFloatType } from 'three';
      โ•ต                                               ~~~~~~~~~

9:32:41 AM [vite] error while updating dependencies:
Error: Build failed with 3 errors:
node_modules/three-stdlib/lights/RectAreaLightUniformsLib.js:1:119: error: No matching export for import "DataUtils"
node_modules/three-stdlib/loaders/EXRLoader.js:1:155: error: No matching export for import "DataUtils"
node_modules/three-stdlib/loaders/RGBELoader.js:1:72: error: No matching export for import "DataUtils"
    at failureErrorW

SSR Compatible

Describe the feature you'd like:

It would be nice to make the three-stdlib server-side compatible.

  • Wrap all usage of the "document" variable with a condition.

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.