Skip to content

Feature/individual script host crates #27

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

Merged
merged 19 commits into from
Aug 11, 2022

Conversation

makspll
Copy link
Owner

@makspll makspll commented Aug 11, 2022

This PR introduces changes which mostly clean up the structure of this crate, this enables 3rd parties to implement language hosts separately from this crate entirely, and makes it clearer what needs to be implemented and how to add support f or another language.
This also allows users to only depend on certain languages.

  • Moves individual script host to separate crates:
    • lua is moved to bevy_mod_scripting_lua
    • rhai is moved to bevy_mod_scripting_rhai
  • Re-structures imports, removing a lot of re-exports to clean up the docs
    • prelude's are added to most crates and all basic functionality just requires importing those
  • All of the script API's are pulled out of the main crate and into bevy_script_api
  • core functionality is extracted to bevy_mod_scripting_core
  • main crate now only contains re-exports to other crates, this helps remove dependency conflicts
  • impl_script_newtype macro now requires #[derive(lua/rhai,..)] attribute attached to the newtype and the right macro imported from the language's derive crate (i.e. lua -> bevy_mod_scripting_lua_derive)
    • this effectively allows mimicking derive macros but with a DSL, and means that the macro instantiation can be used to generate multiple wrappers much more effectively (and at will of the user).
    • the impl blocks also require a language label which corresponds to the langauge's name like so: lua impl {...}, meaning multiple impl blocks can be used, one for each language
  • Also improves CI a bit (macos and windows runners) - 300% more CI in the CI

Not in this PR: ability for APIprovider to provide world,entity etc since right now those aren't available at all, main will break for a while

closes #26

@makspll makspll merged commit 1e08639 into main Aug 11, 2022
@makspll makspll deleted the feature/individual_script_host_crates branch January 20, 2025 14:28
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.

Seperate out languages into their own crates
1 participant