Skip to main content
Version: Next 🚧

Configuration

Server 3D is automatically enabled without any changes to your configuration.

In order to use Client 3D, you need to add an extra field to your relay compiler configuration file: moduleImportConfig.

There are 2 subfields in moduleImportConfig:

  • dynamicModuleProvider: This field defines the way the 3D components will be imported.
  • surface: This field defines the surfaces for which client 3D should be enabled.

These fields are necessary to differentiate between different use cases in Meta's internal codebase, but in OSS they're more straightforward.

dynamicModuleProvider​

In OSS, dynamicModuleProvider has two subfields:

  • mode: This should be set to "Custom".
  • statement: This is the statement that will be used to import your UI module <$module> into the parent component where 3D is being used. You can set it to whatever you need to import your module successfully.

surface​

In OSS, the surface field should be set to resolvers.

Here is an example of what an OSS relay compiler configuration that enables client 3D could look like:

"moduleImportConfig": {
"dynamicModuleProvider": {
"mode": "Custom",
"statement": "() => require('./.<$module>')"
},
"surface": "resolvers"
}

Is this page useful?

Help us make the site even better by answering a few quick questions.