Coder Social home page Coder Social logo

TypeScript Port about nodes7 HOT 6 OPEN

plcpeople avatar plcpeople commented on July 23, 2024
TypeScript Port

from nodes7.

Comments (6)

Lichtjaeger avatar Lichtjaeger commented on July 23, 2024 2

This is only my opinion but I really don't see a reason to convert this project to typescript. Publish a type definition would make sense, but this is a completely different story.

This project needs a rewrite to at least ES2017 but you can use (for example) the babel transpiler for backward compatibility. Or limit the use to engines >= LTS.

from nodes7.

deinok avatar deinok commented on July 23, 2024 2

Well, normaly S7 is used in Industrial environments. Where safety is the way to go. (Types of TypeScript).
About compatibility, using TypeScript dont require any change to any wraper. (If we dont change the public API of this lib)

from nodes7.

deinok avatar deinok commented on July 23, 2024

With TypeScript you can transpile to ES3 like with babel. But with TypeScript you already have the definitions for TypeScript and also you have compile time protection about the usage of types.

from nodes7.

Lichtjaeger avatar Lichtjaeger commented on July 23, 2024

You can also autogenerate the type definitions from JS and type protection means nothing. They don't replace unit tests.

Also, you are transferring the build time to the end user. This results in a bigger memory usage and a longer installation time. The published package should be as small and fast as possible. In your PR you used the wrong hooks and I don't see an optimized .npmignore file.

from nodes7.

deinok avatar deinok commented on July 23, 2024

Well, I didn't do the PR as a final port, only as an experimentation of the concept

from nodes7.

plcpeople avatar plcpeople commented on July 23, 2024

Thanks for the PR. Sorry it took me so long to respond to it. I was able to get this working, although I have not run a lot of tests with real PLCs yet.

I am hesitant to merge the PR - we don't have a lot of experience with TypeScript development, and it's a major change for many people who contribute to (or simply use) nodeS7. I am not sure how this would fit with some major projects that use nodeS7, like the node-red wrappers.

Issue #41 has some discussion of a roadmap to 1.0, and if future major versions are going to use TypeScript, I'd like to see that discussion there.

from nodes7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.