# Plan for "example code"

**URL:** <https://discourse.threejs.org/t/plan-for-example-code/25603>\
**Category:** Questions\
**Tags:** examples, post-processing\
**Created:** [April 22, 2021, 5:24pm UTC](https://discourse.threejs.org/t/plan-for-example-code/25603 "2021-04-22T17:24:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alecmce](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alecmce/32/3074_2.png) [@alecmce](https://discourse.threejs.org/u/alecmce)\
**Post date:** [April 22, 2021, 5:24pm UTC](https://discourse.threejs.org/t/plan-for-example-code/25603/1 "2021-04-22T17:24:28Z")

</div>

It is interesting (and very helpful!) to see we can pull in “examples” like this in our project without any webpack changes:

```javascript
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass'

```

Is there a plan for the post-processing to be moved into the main build? Or are you supporting efforts like `https://github.com/vanruesc/postprocessing` to pull out this code as a sub-library? Or, otherwise, what is the three.js “standard” for consuming this code in a modern manner?

For what it’s worth, the way these are setup now makes using jest very awkward. I’ve found that I’ve had to add

```javascript
  transformIgnorePatterns: [
    'node_modules/(?!three)',
  ],

```

to my jest.config.js just to get them to run, but then it takes a very long time to run as it ends up importing three.js multiple times because of the way the `jsm/../EffectComposer.js` is setup. I’m not looking for help with this in particular, but I’d like to know whether there is a “preferred” pattern, so that we can start buildling our infrastructure around it.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [April 22, 2021, 8:28pm UTC](https://discourse.threejs.org/t/plan-for-example-code/25603/2 "2021-04-22T20:28:14Z")

</div>

> [@alecmce](#):
>
> to my jest.config.js just to get them to run, but then it takes a very long time to run as it ends up importing three.js multiple times because of the way the `jsm/../EffectComposer.js` is setup.

this is finally rectified, i think next version this problem will fade away.

> what is the three.js “standard” for consuming this code in a modern manner?

three has a bit of an odd stance when it comes to modernity, i think most people on here don’t use npm and bundlers (?), every post i open i see … script tags, it’s like a time capsule 😄 but three is on a good path, you can consume it anyway you like. the maintainers are very open minded when it comes to that which is great.

---

<div class="post-metadata">

**Author:** ![alecmce](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/alecmce/32/3074_2.png) [@alecmce](https://discourse.threejs.org/u/alecmce)\
**Post date:** [April 23, 2021, 12:32pm UTC](https://discourse.threejs.org/t/plan-for-example-code/25603/3 "2021-04-23T12:32:14Z")

</div>

Thanks for your response.
