-
Notifications
You must be signed in to change notification settings - Fork 7
Moving forward towards execution with v8 modules. #38
Comments
Awesome work again on #20, @afinch7, let’s keep going :) Right now we're focused on gradually migrating production to the Eventually we'll run the same binary in dev and prod, so during the migration dev tools are a great place to put energy that'll directly inform production. Along with your list, here’s some things our dev tools need to replace our node cli:
If that sounds interesting to you we'd love your help! |
I spent the past week working on some proof of concept code for runtime to runtime communication. I have something that "works", but I had to implement some less than optimal locks to hold it all together. I'm pretty sure a better solution exists, so I would like to get some other input and ideas on that one.
Unless the optimized/bundled code includes
If we can agree that those are reasonable expectations of compatibility I'm all in. Let me know what you think and if there is anything I missed or need to be more specific on. Looking at the features/requirements you have listed; things like
I not sure how you interpreted
I have some ideas with this one. I'm thinking something like the typescript compiler runtime service, but with rollup or webpack instead. Just load up as a service runtime, and send request to bundle with params much like a dns or http request gets passed and processed. I would also like to be able to define some boundaries for blunder inclusions sort of like the "include" and "exclude" options for a tsconfig. Later in the future I would like to have a "project loader" to load an entire folder or git repository in as a single module via some just in time bundling process with caching of course. It would make developing groups of services that are dependent on others much easier. Think
I haven't looked at this much, but I know I want to support typescript as it provides machine readable code documentation. For the others I don't see anything that looks to difficult, I would like to have a little more detail on what you expect on some of them though. More on long term goals: TL;DR; I have some ideas of how to accomplish some of the goals/requirements you set forth, and want to get a little more specific about what compatibility expectations you have for moving from old tools/env to new ones. I give some more detail on what my longer term goals are, and why typescript support is important. That's about all for now. I'm looking forward to getting these features in place, and I'm hoping those expectations bring help get everyone on the same page. I might have another pull request to WIP stage later this week. |
Hey @afinch7, sorry for the slow reply. I think we're on the same page with backwards compatibility, but don't let that slow you down. We're making progress on our end, so hopefully compatibility solves itself before too long. I'm interested in your runtime services idea. We've been thinking about how we can throttle resources for things like image processing, I wonder if there's overlap with your idea. It looks like you have a solid grasp on your next steps. Let us know if you have questions or want to talk through anything. I'm excited to see what you're working on! |
Good to know where are on the same page @michaeldwan. I'm going to see if I can get what I have right now ready for a PR soon. I got a little lost some other projects. I now have a good idea of the scope of integration of custom resolver systems into the editor. Sadly it's not looking to great for that, but creating a abstracted and configurable system ts compilation/loading will be a big help. Just more reason to keep heading down the path of ts compilation in a service runtime. More refinements to service runtimes designI want the design for the service runtime system to fit as many uses as possible, and the way that it supports the other systems it will be a pretty key component. This means I need to put some time and thought into it before I decide on an exact design. I decided that it might be helpful to draw up a diagram to illustrate how I want it to work, and how it all fits into the existing systems. The only part of this system that I'm really still trying to figure out is the communication protocol.
Editor integration is import, but also hard sometimes.I did some research on what it would take to integrate custom resolution into the editor, and it turns out it might require adding some new features to the plugin system for typescript. Some nomenclature for better claritymodule service - The service that resolves, loads, tracks dependency information, etc in a environment. Specifiers and referrer information in; module definitions and compiled code out. resolver - A resolver should be able to take a specifier-referrer combination and spit out a strategy for loading a ES module. The parity problemWhen doing my research on editor integration with custom resolution. I realized we need a way to standardize module resolution configuration to allow for parity between editor language services and fly runtimes. This should include JSON configurable module services. I've have two ideas here on how to tackle this. Option 1: create a network service.This option should be pretty straight forward. Just load up and configure module service, and then listen and respond to requests on local network, so editor integration tools can just talk to the service and get the information they need. This option will take advantage of existing module service code in rust. This option sounds a lot more clunky from the end user perspective, and more of a pain to setup. I really don't like the idea of another thing that a developer has to setup and configure/troubleshoot. This one kinda goes against my original goals by adding another step for developers instead of removing steps. Option 2: move another system into a service runtime.This option would likely require a lot more work and thought, but I like the flexibility and it should make it easy for others in the industry integrate with and collaborate on this system. This solution doesn't necessarily entirely exclude the first option either. The standard here could easily include the option to talk to external service for resolution/loading. The goal is to make the module services system it's own package and implement it into a runtime service and editor plugins. This package could easily allow for end users to setup custom revolvers in their configurations. I've played with this one a bit, and I really like the idea importing custom resolver factories as modules via dynamic imports. To maintain flexibility and security in fly I think that custom resolver resolution should be a part of implementation of the package. Implementors need control over what resolvers can be used and where their respective code comes from. In general I like this idea alot. I've noticed several others that are interested in the idea of dynamic module resolution, so I might try to round up those interested and get their ideas. This makes for a good opportunity for community collaboration, and would go a long ways towards a dynamic module resolution standard. Once a standard can be established those who use it in their projects could easily move from one platform to another eliminating another barrier to entry. ConclusionsI look forward to where all this goes, and I want to know what others think. |
I just finishing up my PR for a modular module resolver system #20. I've gotten familiar with the code base, and thought about what features I need in fly and what features might be useful to others. I have decided that my first big goal is move code execution over to the module system in v8. This should allow for more dynamic dependency resolution and analysis in a way that isn't as heavy(and insecure) as running typescript compiler/language services in each runtime. Moving import control out of the runtime will make import metadata like referer more trustworthy sources of information, so some form of security can be established for things like secrets from imports. In general I want to make dynamic module resolution and loading more production friendly.
I've come up with an approach that is designed around making flexible and extensible systems from simpler goals, so that I can be adding value to the project with each step along the way. Here is my list of smaller goals:
Modules
.SourceLoader
for typescript code that uses these new systems.Script
toModule
.Note the first two are already done I started working on this while working on #20, but as I got a better feel for the scope of this goal I saw that It was far to much for one PR.
That about sums up my goals for the next month or so. I welcome any feedback/ideas since most of this is in no way final.
The text was updated successfully, but these errors were encountered: