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

Export luma functions #8822

Merged
merged 3 commits into from Apr 26, 2024
Merged

Export luma functions #8822

merged 3 commits into from Apr 26, 2024

Conversation

chrisgervang
Copy link
Collaborator

Background

How should a scripting application use luma 9 to register or create devices? Or in my case, call enforceWebGL2 from a bug repro.

I'm not exactly sure what the solution is, so I'm starting by proposing the simplest one. It comes with a downside that the script would access the functions with luma.luma.createDevice, which is not super elegant.. alternatively we could remove the nesting by spreading the functions onto the export.

Change List

  • Add luma namespace functions to the pre-built bundle.

How should a scripting application use luma 9 to register or create devices? Or in my case, call `enforceWebGL2` from a https://codesandbox.io/p/sandbox/deck-v9-maplibre-interleave-repro-8602-mapbox-v1-fork-4hwfff?file=%2Findex.html%3A16%2C1. Add `luma` namespace functions to the pre-built bundle.
@coveralls
Copy link

coveralls commented Apr 23, 2024

Coverage Status

coverage: 90.026% (+0.002%) from 90.024%
when pulling 43dc540 on chrisgervang-patch-1
into e823e40 on master.

@Pessimistress
Copy link
Collaborator

I would expect this luma export to be the very same globalThis.luma object. @ibgreen is there any downside of doing that? Should this be handled in @luma.gl/core instead?

@chrisgervang
Copy link
Collaborator Author

v9 introduced a luma namespace within the core for some static functions. I think the scripting package can export these however it wants since we can document the mapping

@ibgreen
Copy link
Collaborator

ibgreen commented Apr 24, 2024

I would expect this luma export to be the very same globalThis.luma object. Should this be handled in @luma.gl/core instead?

Agreed, It probably makes sense to add the functions in the luma "namespace" to globalThis.luma (rather than globalThis.luma.luma) in the script bundle built by @luma.gl/core (edited).

@ibgreen is there any downside of doing that?

I suppose the downside is that the concepts are unrelated and it could cause some minor confusion, but as @chrisgervang says it is up to us to define the mapping.

@Pessimistress Pessimistress merged commit 1e53513 into master Apr 26, 2024
4 checks passed
@Pessimistress Pessimistress deleted the chrisgervang-patch-1 branch April 26, 2024 21:01
Pessimistress pushed a commit that referenced this pull request Apr 26, 2024
Signed-off-by: Chris Gervang <chris@gervang.com>
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

4 participants