GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alvsgithub/NativeScript at 9eb66d8a462bf74deec076e871e6d0cf7eff40e2

BranchesTags
Open more actions menu

Latest commit

 

History

473 Commits
473 Commits

Folders and files

NameName
Last commit message
Last commit date
application
application
 
 
apps
apps
 
 
build
build
 
 
camera
camera
 
 
color
color
 
 
console
console
 
 
data
data
 
 
file-system
file-system
 
 
fps-meter
fps-meter
 
 
globals
globals
 
 
http
http
 
 
image-source
image-source
 
 
js-libs
js-libs
 
 
local-settings
local-settings
 
 
location
location
 
 
platform
platform
 
 
text
text
 
 
timer
timer
 
 
trace
trace
 
 
ui
ui
 
 
utils
utils
 
 
xml
xml
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
CodingConvention.md
CodingConvention.md
 
 
CreateNewModule.md
CreateNewModule.md
 
 
CrossPlatformModules.csproj
CrossPlatformModules.csproj
 
 
CrossPlatformModules.sln
CrossPlatformModules.sln
 
 
DebugV8Heap.md
DebugV8Heap.md
 
 
LICENSE
LICENSE
 
 
Readme.md
Readme.md
 
 
_references.ts
_references.ts
 
 
android17.d.ts
android17.d.ts
 
 
declarations.android.d.ts
declarations.android.d.ts
 
 
declarations.d.ts
declarations.d.ts
 
 
declarations.ios.d.ts
declarations.ios.d.ts
 
 
gruntfile.js
gruntfile.js
 
 
ios.d.ts
ios.d.ts
 
 
libjs.d.ts
libjs.d.ts
 
 
package.json
package.json
 
 
source-control.md
source-control.md
 
 

Repository files navigation

NativeScript Modules

#What are the cross-platform modules The cross-platform modules repository contains the framework to be used for writing code that will run on any of the platforms, supported by NativeScript.

#Basics For faster and more stable development, the modules are written in TypeScript, that gets 'transpiled' to JavaScript, which actually runs on the target device. To have that, the JavaScript code is accompanied with a set of platform-specific (native) binaries, called runtimes. These are a middle layer, running the JavaScript code on the device.

#Code organization Each runtime provides JavaScript wrappers over the native platform classes. The classes in the cross-platform modules are common wrappers over the native wrappers, organized in a manner, allowing the straightforward development of powerful cross-platform mobile applications. A cross-platform class would typically have different imlementations for the different platforms. The cross-platform library must have them both and decide which one to use. To avoid runtime checking, a convention is chosen that any files, named *.[platform].ts (and, respectively, *.[platform].js) are valid for the specific platform only. That way, common API gets only declared in a file, named file-system-access.d.ts while its iOS and Android implementations get coded in the file-system-access.ios.ts and file-system-access.android.ts respectively.

One would notice the apps folder, which does not fit the notation of a module. Normally each of the subfolders of the apps folder would be a separate repository or a project, with its own build and packaging. For a faster and more stable development, aided with code completion and due to limitations in Visual Studio, the current setup is chosen.

#Steps to build the CrossPlatformModules solution:

#Before start

  1. Make sure you have nodejs and npm installed
  2. Navigate to the CrossPlatformModules directory
  3. Run npm install -g grunt-cli (to be able to trigger the grunt build).
    Note: Might require sudo permissions on some *nix systems
  4. Run npm install (will install the dependencies and devDependencies)

#Visual Studio and Project Structure The CrossPlatformModules project calls a grunt task that transpiles the typescript code to JavaScript.

A module file that cannot have a common implementation across the platforms would have a modulename.d.ts file, containing the declarations of the module API and modulename.[platform].ts files, containing the actual platform-specific implementation of the module functionality. The modulename.d.ts file in that case is used by Visual Studio as an intellisense helper, forcing the Visual Studio typescript compiler to feed its definitions from the *.d.ts file rather than the implementation one.

When built, the project outputs npm packages, containing the fully transpiled code. There is a package for the modules only and packages for each subfolder of the apps folder, each representing a standalone cross-platform NativeScript application.

Useful links

VSCommands

Adds the option to "Group Items" (DependentUpon tag) within the Visual Studio Solution Explorer. Select several items, right-click -> Group Items.

A comparison of various features and APIs across mobile platforms

CLI

Run grunt to have the the packages built and output to the bin/dist subfolder.

About

Open Source framework for building cross-platform truly native iOS, Android and Windows mobile apps using JavaScript.

www.nativescript.org

Resources

Readme
License

Contributing

Contributing
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.