I’ve been using es-module-lexer to flatten modules on the server this weekend.. haven’t had so many recursion dreams in a long while 
-
-
Replying to @lukejacksonn @hsablonniere
ahhhh man you stole my todo item hahapic.twitter.com/ejALadRomG
1 reply 0 retweets 1 like -
are you able to publish the code? I'd love to get a head start on this.
1 reply 0 retweets 1 like -
Replying to @_developit @lukejacksonn
What do you mean by "flatten modules on the server"
1 reply 0 retweets 0 likes -
Replying to @hsablonniere @lukejacksonn
take a nested module graph and collapse it into a single module. not sure if he's doing scope merging since es-module-lexer doesn't retain that info.
1 reply 0 retweets 1 like -
Replying to @_developit @hsablonniere
Hah, what a coincidence eh! But yep the idea is as Jason says.. take a request for a file, parse and fetch the dependency graph then return a single module. There is a twist though.. I’m not smart enough to AST so am not rewriting code/scopes, rather, just import paths.
1 reply 0 retweets 1 like -
Seems to be working pretty nicely now.. just tidying up the code. Will share soon!
2 replies 0 retweets 2 likes -
-
Replying to @sebinsua
So, I think I conflated too many ideas when implementing this and it’s probably all wrong.. but it works as a proof of concept and I got to learn a bunch so here is the write uphttps://github.com/lukejacksonn/blub …
2 replies 0 retweets 2 likes
Very cool of you to release a POC. No worries about design choices probably being wrong (etc), seeing different implementations is helpful for understanding the problem better!
-
-
Replying to @sebinsua
That’s how it should be
well I’d love to know your thoughts/ideas if you have any!2 replies 0 retweets 0 likes -
Replying to @lukejacksonn
"The browser could even communicate to the server what it has already received in its request and make sure those seen files aren't sent down again as part of future bundles." Do you mean with HTTP Range requests or via some kind of query string?https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests …
1 reply 0 retweets 0 likes - 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.