<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 2 déc. 2021 à 02:02, Pirate Praveen <<a href="mailto:praveen@onenetbeyond.org">praveen@onenetbeyond.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
2021, ഡിസംബർ 1 9:52:45 PM IST, "Jérémy Lal" <<a href="mailto:kapouer@melix.org" target="_blank">kapouer@melix.org</a>>ൽ എഴുതി<br>
>Le mer. 1 déc. 2021 à 16:41, Pirate Praveen <<a href="mailto:praveen@onenetbeyond.org" target="_blank">praveen@onenetbeyond.org</a>> a<br>
>écrit :<br>
><br>
>><br>
>><br>
>> 2021, ഡിസംബർ 1 5:18:25 PM IST, "Jérémy Lal" <<a href="mailto:kapouer@melix.org" target="_blank">kapouer@melix.org</a>>ൽ എഴുതി<br>
>> >Hi,<br>
>> ><br>
>> >To work around the bootstrapping issue that is posed by the huge loop<br>
>> >of build-dependencies:<br>
>> >nodejs -> node-acorn -> rollup -> zillion things -> nodejs,<br>
>> >it is possible to make a stage 1 nodejs build that loads node-acorn<br>
>> >*source* files,<br>
>> >instead of the compiled ones.<br>
>><br>
>> If nodejs 16 can handle acorn source files (ES6) directly, can we just<br>
>> skip the build of acorn ? So we can drop nodejs build dependency.<br>
>><br>
><br>
>yes, it can be skipped, for stage 1 build.<br>
>But the configuration options used for that build are not supported by<br>
>upstream<br>
>for anything else than development, and it has a non-negligible impact on<br>
>nodejs initial load time.<br>
>So as soon as node-acorn can be built (by rollup), normal nodejs build must<br>
>be done.<br>
<br>
I'm suggesting we ship node-acorn as ES6 source only (remove build steps from current node-acorn itself) if our nodejs can handle it. Rollup might be needed only for compatibility with older nodejs versions which we don't need to support.</blockquote><div><br></div><div>Unfortunately, it's not that simple.</div><div>Short version: internal acorn *need* to be in commonjs format.</div><div><br></div><div>In Node, internal modules are built into a single c file, to allow<br></div><div>a very fast "boot". They are all in CJS format.</div><div>The possibility given by Node to load internal modules from a directory</div><div>instead, is only there for development purposes (indeed, very handy for hacking</div><div>into internal modules).</div><div>I'm using that option to patch (by using internal esm loader to do dynamic import)</div><div>how acorn is loaded by internal modules - but that's not something we want</div><div>to keep around in debian. It might have subtle side effects, bugs, and performance issues.</div><div><br></div><div>Adding node-acorn source into nodejs source tarball was made easy</div><div>thanks to uscan component support. I have yet to finish the patch for</div><div>dynamic import.</div><div><br></div><div>Jérémy</div><div><br></div><div><br></div></div></div>