Does anyone have any experience in getting <invers...
# suitescript
d
Does anyone have any experience in getting inversify.io working in Netsuite? I really need dependency injection working. I'm using typescript, using https://github.com/headintheclouddev/typings-suitescript-2.0 type definitions. I can get everything working locally. But the reflect-metadata package, a UMD module, transpiles down to the following:
Copy code
define(["require", "exports", "N/log", "../services/service-factory", "reflect-metadata"], function (require, exports, log, service_factory_1)
where
"reflect-metadata"
cannot be found, as it's not a relative url. I'm not sure how to reference the global UMD module and get it all working in Netsuite
b
probably involves finding the module with the id reflect-metadata
and setting up a require Configuration
you may want to make sure your tsconfig.json is setup correctly
s
I'm curious as to the motivation for DI in your suitescript? unit testing or ?
b
id like to add that suitescript 2.0 is the opposite of a modern JavaScript environment
d
I'm curious as to the motivation for DI in your suitescript? unit testing or ?
@stalbert hi stalbert, yeah for unit testing but also ease of managing dependencies between all the services and mappers
id like to add that suitescript 2.0 is the opposite of a modern JavaScript environment
@battk Agreed, that's why I use typescript and transpile down to EMCAScript 5.1
s
I'm transpiling down to ES2018 lately 🙂
d
@stalbert great, is SS2.1 not in beta?
s
@Darren I'd invite you to check out NFT - I haven't tried using DI with it but it's a class/object oriented solution that may lend itself well to IOC/DI https://github.com/ExploreConsulting/netsuite-fasttrack-toolkit-ss2
I believe SS 2.1 is GA as of 2020.1
unless I misread the release notes. So some people are already on 2020.1 - others still waiting but it will be everywhere soon.
d
Brill, i'll see what can be done with 2.1, maybe I'll find something useful. That NFT toolkit looks very interesting, I'll check it out.