-
Notifications
You must be signed in to change notification settings - Fork 3k
Compiles javascript source file directly into code. Removes Bundle-loading. #129
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
Conversation
Going to try and make it more explicit what is public. |
Okay, we're back on. |
@mbishop-fiksu That's a cool way of including the JS. Do you mind explaining the benefit this would provide? Is it just performance? (PS: there's been a few changes to master that you might want to merge in). |
@lokimeyburg Be happy to answer your very good question. It's more than performance. Let's say a developer wants to write a plugin that contains WebViewJavascriptBridge. With the current system, the developer needs to ask anyone using the plugin, "can you also please include this resource in your app?". By removing the resource and compiling the code into the plugin, the only dependency needed to include the plugin is the library. |
@mbishop-fiksu Cool. Thanks for the explanation. My only worry at the moment with this PR is hiding the Javascript (in an Objective-C file) and obscuring an implantation detail (how it get's added to your project). For a start, I think renaming the file to something like I'll take a deeper look at the PR later next week when I'm back from vacation. Good job - I didn't know about the preprocessor trick! |
+1 for separate file, clear mention in the code of what's going on, and merge into master |
Added explanation to _JS.m file.
…paration for merging in #129 which inlines the javascript source via a .m file preprocessor macro
Removes the requirement of specifying a bundle. The compiler now makes a string constant from the javascript source and always uses that when seeding the WebView.