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

Generate umd library #90

Closed

Conversation

cristiano-belloni
Copy link

To make fengari work with Webpack, it has to be built with the umd libraryTarget. Unfortunately, Webpack seems to break an instanceof assertion (though the instances seem to be the same in the developer tools). I removed it - don't know if there's a better way.

@daurnimator
Copy link
Member

The instanceof assertion is quite important.
You should only load fengari once in any javascript VM (just as you should only load the lua C library once in a given process). Or at least: you should never mix fengari libraries (e.g. passing a state created by one to the lua.lua_pushstring function of another)
If you have errors, it implies that you included the fengari library more than once into your program.

Fengari itself should rarely be built as a library, it should be included by other projects with an entrypoint (such as fengari-web or fengari-node-cli).

Additionally, I do not think including build artifacts inside of a repository is ever a good idea.

@daurnimator daurnimator closed this Oct 2, 2017
@cristiano-belloni
Copy link
Author

it should be included by other projects with an entrypoint (such as fengari-web or fengari-node-cli)

Curious about this one: I'd be terribly happy to just use fengari-interop in my project, but it seems it's not possible to load scripts with it (My use case is loading Lua code from a string, and the only way I found is using lauxlib.luaL_dostring from fengari).

@daurnimator
Copy link
Member

Curious about this one: I'd be terribly happy to just use fengari-interop in my project, but it seems it's not possible to load scripts with it (My use case is loading Lua code from a string, and the only way I found is using lauxlib.luaL_dostring from fengari).

Have a look at how fengari-node-cli or fengari-web are written.

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.

2 participants