-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions and Ideas #57
Comments
I must admit at some point I scrolled to the bottom of your post, trying to find your questions. I'm more familiar with typescript then with JS module building. But I know enough about it, to be able to build this tool, as of now. Using less tools and writing code against such a low level API (currently) brings the benefit of reduced complexity and things to consider. But I already hit some walls when trying refactor this package to be more modular, so it might make sense to switch to more sophisticated tooling. But: One goal/decision was to be able to work with node 10. So it's nice that with newer versions this tool would need less code, but as long as node v10 is a requirement for me, this could only be an optimization. Currently the module is doing mostly great for what I need it to do, and although I have some ideas, it's not currently in my focus. (Contributions, suggestions, ideas, questions are very welcome and I'm open for PRs!) Let me know if I addressed/answered at least some of your questions. And if not, let's talk about them one by one: pick one, and try to be as precise as possible when putting it in a reply. |
yeah, it turned out to be less about asking questions as about introducing ideas...
It's also not about nescessarily transforming this project. (even thogh it has a great name. I can't believe that it was still awailable on npm)
sure. it wasn't suposed to be ultra clear anyways, it's for just for starting a discord, ordering my thougts and to serve as notes. so no worries. before i go into detail:
I took a look at one of your TS projects, the import/export you use there is modeled after EcmaScript-module-specs, so you are allready plenty familiar with writing es-modules. the only real difference between how typescript does it and vanilla-JS/ES is that you need to add a file extention if you are directly importing a file. eg: import * from './path/to/file'
// becomes:
import * from './path/to/file.js'
// packages can be imported the same way tho
import * from 'some-package' and if the source is written in typescript, i think that will be handled by the compiler. i always include the extension in typescript too, as it's closer to how it's done in JS So this paragrapf from my post:
becomes moot, the answer is: in your ts-projects, You are allready doing exactly what i suggested. So this probably answers many of your questions: you should be able to to all the things you are able to do in your ts-projects for reference, i plopped a file from tslint-report into the ts-playground with the
It can be transpiled to work with node 10 without a problem. And to directly run a ts file ts-node has been working on experimental esm-support for a while. runtime compilation of ts should't be used in production anyways, but it's great for testing and developing.
Implementation of the things i mentioned is certainly possible in earlier versions and without using esm, but:
I do have an actual question this time:
may i ask why? just curious *Note: node v10 reaches end-of-life in less than a year (2021-04-30), that's not too far away, don't forget that. And v14 will enter active long-term-support soon (2020-10-20), officially labeling esm as stable. I hope things have now become a lot clearer |
The very personal answer is that there is a piece of infrastructure this script is used on that can currently not be updated. Relying on ts-node for execution of this lib is not an option for me:
Thx for elaborating on the differences between ES modules and typescript. |
from my last comment:
I'm not that mad, lol and asfar as compiling goes, it's very straight forward. It's just 2 settings in the the tsconfig.json. the compiler will do the rest for you. same file as before on the ts-playground but with the options But again, it's not my goal to neccessarily transform this project. I must admit, i went a bit over the rails with my 'introduction'. |
Ah although it was the first thing you wrote initially, all the text after it made me not pay attention. So I went back and read your initial post again. So: I agree that the current status of npx is at least a pitty, but rather unbearable. But even after (finally) reading your whole text, I don't understand anything actionable or answerable in it. So what exactly do you want to discuss? Best Christian |
Yeah, completely my fault. As i said, i went overboard. I was trying to extensively express my ideas and kinda forgott about the framing.
no worries. it's currently mostly a thoughtmap. it's important that i understand it's clear meaning so i don't forget about stuff
Not currently, I'm technically still in the idea-phase. this thread was never really supposed to be what it's become. But for such things GH-issues are great because they create a nice creation-process documentation. Can't really make a specific project because these ideas can't be just a single project. Again, my apologies for abusing your project for my rambeling. I'll tag you on the project once it's up. EDIT: and don't judge my skill or conventions by my repos. most of them are a comlpete mess and were created mostly to experiment, lol |
OK, sure, count me in on brainstorming, experiments, "whatever" 😉 |
I found your question in the npx repo and found this repo, but I have a few questions.
Background
I'm working on various dev-utilities because many of the commonly used ones were designed around archaic JS/ES functionalities and are often incompatible with (or not worth the effort to make them work with) my es2020/esNext projects.
Currently my focus is around:
improved integration and simplified usage of package(-lifetime)-scripts and shell-like scripting
Package scripts are an incredible tool for both development and in deployment but setting them up is complex and time consuming and creating a good default implementation is even harder. so I've been experimenting around and I think using small and standardized modules that can be scripted and used programmatically as needed is the smartest way to go.
One thing I think this could enable are small scripts and services able to work together and independently, sharing data in a loose swarm where both shell-like scripting and programmatic usages can work together to be both flexible and not configuration intensive. this would be the holy grail, but this will be incredibly hard to make functional.
simplifying dependency maintenance and dep-tree integrity to avoid Dependency-Hell
Many parts of the JS ecosystem are stuck in a dependency-hell, because they were started when invariance of packages was the common way to ensure stability in programming. The language and its foundations have been advancing at high speed for many years now, yet this principle of invariance is still common and techniques that have been considered bad practice for years or have much much simpler modern alternatives are still regularly recommended all over the place.
It would be great for new projects to be as easy as possible to modernise as they age. I think the smart way to do that is focusing on easy adaptability instead of base-level compatibility and on creating flexible interfaces that can be switched out easily if needed and basing convention at this top-layer instead.
Pressuring users to update/-grade constantly by issuing deprecation early, and making it easy to do so is the smart move now.
for this it's important to look at the upcoming changes in the language and your frameworks and prepare ahead of time to adapt as soon as possible so the user has the ability to do the same.
general maintenance automation based on and around a modern infrastructure
The physical infrastructure has advanced to a point where resources for programming is abundant. Bandwidth is large enough to support updating something for even the most minor changes, and processing power is plenty enough to do so passively with negligible performance impact instead of on-use.
For this I plan on working on a way to include micro-services seamlessly in a project with similar functionalities as GitHub-actions but for client- and dev-side use instead of in a repository
easier creation and configuration of projects implementing and aiding in creation of the aforementioned points
This is probably the biggest roadblock for me right now. Having a boiler-plate be as current as possible will require adaptive automation, dynamic recommendations and an easier way to configure and initialize complex projects than anything I've found.
For this reason I think my first point is the most urgent.
following
I see you are working on a few similar things and I'd be very interested in exchanging ideas.
on that note, I see that your code base is rather modern. What are your thougts on switching over to using ES-modules? They would solve a couple of the issues you talk about in the readme not with anything that adds complexity but by their very nature. eg.
.d.ts
-files making very strict convention less relevant.--harmony-top-level-await
)on a related note, I see that you added typings, you could switch to typescript directly, as with modern ES-features and using vanilla-style typescript and ESM, you can write code that only needs to be stripped of type-annotations to be valid JS/ES-code, this way the
.d.ts
-files don't have to be written seperatly and the code gets basic documentation as you go, making coding more consistent and modifying code easier and less error-prone.If you need a more detailed explanation on any of this, feel free to just ask.
and my apologies for writing that much, lol
The text was updated successfully, but these errors were encountered: