ByNumber Posted November 11, 2019 Posted November 11, 2019 Hi, I only found one reference to TypeScript in the forums. I assume TypeScript is not supported or unpopular? I would like to port a complex Swift iPhone app ( https://www.PsychologyByNumber.com ) to a web-based application to support non-iPhone devices. The Javascript language is too simplistic. I need true class inheritance and Swift-like enum support. How have you solved around this problem? Thanks, Mike
bfarber Posted November 11, 2019 Posted November 11, 2019 That's a complex question that probably is not best directed at us. Our software doesn't "support" javascript really - the end user's browser does (99.9% of the time)...we simply print out the javascript with the expectation that the user agent consuming the page will be able to process it. Nothing stops you from integrating other languages such as vbscript or typescript, however really it is then up to the user agent consuming the page as to whether they understand and can support said language(s). From my understanding, typescript can be converted to javascript, so presumably you could write your application and then transcompile it over to javascript and then simply use that. I would expect this would be your safest bet with the widest range of support.
ByNumber Posted November 11, 2019 Author Posted November 11, 2019 I wasn't specific enough. TypeScript can run on the server side or compiled in the client to javascript. I was referring to running on the back end. Do you offer support to execute TypeScript on the server side? The iPhone app creates and processes data in json file format. I need some way to store the json files on the server for each user. Processing all data on the server side makes more sense to me.
Daniel F Posted November 11, 2019 Posted November 11, 2019 21 minutes ago, ByNumber said: I wasn't specific enough. TypeScript can run on the server side or compiled in the client to javascript. I was referring to running on the back end. Do you offer support to execute TypeScript on the server side? The iPhone app creates and processes data in json file format. I need some way to store the json files on the server for each user. Processing all data on the server side makes more sense to me. You could implement this yourself. In fact, I did once something similar for a project, where I used the FileStorage extension to create unique json files containing "almost static data" for specific stuff which were then accessed and used by the JS code. You could also just use php controllers with a json response 🙂 In my case it made sense to create the static files because the data were quite static ( e.g. list of forums, list of member groups ) so I needed to rebuild them only once a while when they really changed.
ByNumber Posted November 11, 2019 Author Posted November 11, 2019 The users will be editing the json files quite intensely. The file is a tree structure nested six levels deep. Each tree node is rated and evaluated to see it passes a specific threshold range. The file structure can become quite large, because the tree is completely editable. The data exported to a google sheet might give you a better idea, https://www.psychologybynumber.com/default-structure.htm/ I need to execute the TypeScript on the server. How is TypeScript invoked on the server?
ByNumber Posted November 12, 2019 Author Posted November 12, 2019 I probably made a mistake choosing this platform. I have learned of at least three server packages that execute Swift code. One package compiles Swift directly and runs it natively. Another transpiles Swift in node.js code.
bfarber Posted November 12, 2019 Posted November 12, 2019 I am unclear what you are asking when you ask if "we" can support Typescript. This is a language, and if you need to support a specific language then you will want to ensure your web host supports that language. If you are asking if we support this with our Community In The Cloud offerings, then the answer is no. Otherwise, it is really up to your web host as to which languages they support in their hosting environment.
ByNumber Posted November 12, 2019 Author Posted November 12, 2019 I am actually asking if Community in the Cloud supports server-side Swift language execution . My domain name points there. The forums are just one feature of the larger web site. The main function is editing files for non-iPhone devices. The code base is written in Swift. The most practical solution is to share as much Swift code between the iPhone and server as possible. Apple provides the backend for iPhone files. I only need to implement iOS UIDocument API to get all the backend functionality at no additional effort. Supporting non-iPhone devices requires that I implement the backend myself.
ByNumber Posted November 12, 2019 Author Posted November 12, 2019 Has anyone tried Vapor? https://vapor.codes
bfarber Posted November 13, 2019 Posted November 13, 2019 21 hours ago, ByNumber said: I am actually asking if Community in the Cloud supports server-side Swift language execution No, it does not. Our Community In The Cloud service is designed to host your community, and that's it. If you need additional language execution and things of that nature, you will need your own server that supports those languages.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.