@blotch/angular-lynx-native 22.2.21 → 22.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +4 -0
  2. package/dist/android/build.d.ts +6 -1
  3. package/dist/android/build.d.ts.map +1 -1
  4. package/dist/android/build.js +14 -3
  5. package/dist/android/run.d.ts +10 -1
  6. package/dist/android/run.d.ts.map +1 -1
  7. package/dist/android/run.js +46 -1
  8. package/dist/dev-build.d.ts +16 -0
  9. package/dist/dev-build.d.ts.map +1 -0
  10. package/dist/dev-build.js +44 -0
  11. package/dist/generate.d.ts +24 -5
  12. package/dist/generate.d.ts.map +1 -1
  13. package/dist/generate.js +14 -6
  14. package/dist/index.d.ts +12 -3
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +65 -9
  17. package/dist/ios/build.d.ts +14 -1
  18. package/dist/ios/build.d.ts.map +1 -1
  19. package/dist/ios/build.js +10 -6
  20. package/dist/ios/iphone.d.ts +1 -1
  21. package/dist/ios/iphone.d.ts.map +1 -1
  22. package/dist/ios/iphone.js +4 -1
  23. package/dist/ios/project.d.ts +8 -1
  24. package/dist/ios/project.d.ts.map +1 -1
  25. package/dist/ios/project.js +17 -3
  26. package/dist/ios/run.d.ts +1 -1
  27. package/dist/ios/run.d.ts.map +1 -1
  28. package/dist/ios/run.js +4 -1
  29. package/dist/run.d.ts +42 -2
  30. package/dist/run.d.ts.map +1 -1
  31. package/dist/run.js +16 -1
  32. package/package.json +1 -1
  33. package/templates/android/app/src/debug/java/dev/angularlynx/shell/DevServer.kt +159 -0
  34. package/templates/android/app/src/debug/java/dev/angularlynx/shell/DevServerModules.kt +163 -0
  35. package/templates/android/app/src/debug/res/xml/network_security_config.xml +13 -0
  36. package/templates/android/app/src/main/java/dev/angularlynx/shell/AssetsModule.kt +22 -0
  37. package/templates/android/app/src/main/java/dev/angularlynx/shell/MainActivity.kt +8 -1
  38. package/templates/android/app/src/main/java/dev/angularlynx/shell/ResourceFetchers.kt +12 -6
  39. package/templates/android/app/src/release/java/dev/angularlynx/shell/DevServer.kt +24 -0
  40. package/templates/ios/App/AssetsModule.swift +21 -3
  41. package/templates/ios/App/BundleResourceFetcher.swift +46 -2
  42. package/templates/ios/App/DevServer.swift +190 -0
  43. package/templates/ios/App/DevServerModules.swift +223 -0
  44. package/templates/ios/App/LynxViewController.swift +9 -1
@@ -40,6 +40,8 @@ final class LynxViewController: UIViewController {
40
40
  }
41
41
  // Bundled files for the main thread's fetch and Image (AssetsModule).
42
42
  config.register(AssetsModule.self)
43
+ // `ng serve --platform ios`'s live reload, in the development build.
44
+ DevServer.shared.register(in: config)
43
45
  let lynxView = LynxView { builder in
44
46
  builder.config = config
45
47
  // Lets main-thread code, where Angular runs, call the config's modules
@@ -59,7 +61,13 @@ final class LynxViewController: UIViewController {
59
61
 
60
62
  layoutLynxView()
61
63
  lynxView.updateGlobalProps(with: globalProps())
62
- lynxView.loadTemplate(fromURL: "main.lynx.bundle", initData: nil)
64
+ // The bundle inside the app, or in the development build, the dev
65
+ // server's, which it loads again on every edit.
66
+ let templateURL = DevServer.shared.templateURL
67
+ lynxView.loadTemplate(fromURL: templateURL, initData: nil)
68
+ DevServer.shared.attach(to: view) { [weak self] in
69
+ self?.lynxView?.loadTemplate(fromURL: templateURL, initData: nil)
70
+ }
63
71
 
64
72
  // Send the new theme when the phone switches between light and dark
65
73
  // while the app is open. Before iOS 17, traitCollectionDidChange does.