Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine in Webpack #481

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Engine in Webpack #481

wants to merge 29 commits into from

Conversation

trusktr
Copy link
Contributor

@trusktr trusktr commented Aug 24, 2015

(Discussion, don't merge)

This PR makes Engine work in Webpack, but breaks browserify support.

The solution will be to keep the current syntax (not the one shown in this PR), then use Webpack's transform-loader to apply the glslify transform to files in Webpack builds, but that won't work until the following issue is solved: webpack/webpack#1373

cc: @talves

alexanderGugel and others added 29 commits July 29, 2015 19:47
This refactor solves a number of issues ans subtle bugs that are
present in the current implementation. No breaking changes have
been made.

* Usage of defaultGeometry: Previously a single defaultGeometry has
  been used for all Meshes that didn't have a geometry set on them.
  Since it was possible to retrieve and mutate the geometry, mutating
  the geometry of one Mesh would have resulted into unexpected
  results (since the geometry was shared among all Meshes).

* Primitives inherit from Geometry: Although the methods were
  documented as constructors, they actually instantiated a new
  Geometry and returned it. This resulted into confusing
  `instanceof` and `constructor` checks. The new keyword is still
  optional, there this is not a breaking change.

* Deprecate Mesh#setGeometry's geometry register: Accepting
  geometries as strings is problematic, since it means that **all**
  geometries will be required and included in the bundled file (as
  pointed out on phabricator). Currently a console.warn is used for
  printing the deprecation notice.
Previously wasn't an issue, since:

1. There were no registries
2. Meshes were never being removed
In the current implementation a new typed array is being instantiated on
every subData call using `concat`. This should be factored out by sending
the data as a transferable ArrayBuffer through postMessage, resulting
into a zero-copy transfer. For the time being, we can at least remove the
obsolete cloning of the array using concat.
* throws an error instead of console.error when WebGL is not supported
  otherwise this.gl is undefined and the errors would be pretty confusing for
  users in either case)
* WebGLRenderer#getContext returns the previously retrieved GL context if
  available
This change is intended to make the behavior of Dispatch#dispatch more
intuitive behavior by dispatching the event on the original "source node"
(the passed in node).
Dispatch#dispatch was not calling onReceive on the nodes' components.
Equivalent of f6b1dde

Needed for nesting DOMElements within Meshes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants