[x3d-public] import fs as ‘fs’. Babel?

John Carlson yottzumm at gmail.com
Fri Mar 17 17:56:18 PDT 2023


I think the fs JavaScript import may be okay for now.  Development has
swapped to removing use of XMLSerializer on the server.  At least that’s
the next place I’ll look.

Thanks for listening!

John

On Fri, Mar 17, 2023 at 7:42 PM John Carlson <yottzumm at gmail.com> wrote:

> The problem seems to be I’m sharing code between client and server when i
> shouldn’t.
>
> Hmm!
>
> John
>
> On Fri, Mar 17, 2023 at 11:30 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Any help integrating XMLSerializer into index.mjs referenced by
>> index.html would be appreciated! It's perfectly fine if you start from
>> scratch, but make sure that the result code runs in the browser.  You might
>> even try leaving out the import altogether!
>>
>> I am pretty sure the latest nodejs module is "@xmldom/xmldom".
>>
>> Thanks!
>>
>> I currently have:
>>
>> $ cat index.mjs
>> import fs from 'fs';
>> import dom from "@xmldom/xmldom";
>>
>> var ser = new dom.XMLSerializer();
>>
>>
>>
>>
>> On Thu, Mar 9, 2023 at 5:15 AM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Here is a basic webpack/babel/express/https example for loading node.js
>>> .mjs files with
>>>
>>> import fs from "fs"
>>>
>>> into the client.
>>>
>>> Let me know if you get any errors.
>>>
>>> If anyone wants to create a tutorial (there are *way* too many options
>>> online) or otherwise copy over to X3DJSONLD, let me know.
>>>
>>> https://github.com/coderextreme/fstest
>>>
>>> This is up-to-date everything except nodejs, which is at: v18.13
>>>
>>> I'm hoping to progress with X3DJSONLD fairly soon.
>>>
>>> Thanks!
>>>
>>> On Thu, Feb 23, 2023 at 7:40 PM John Carlson <yottzumm at gmail.com> wrote:
>>>
>>>> Does anyone know how to use JavaScript server code on client?   I think
>>>> the answer is Babel.
>>>>
>>>> Thanks!
>>>>
>>>> John
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230317/d18929b4/attachment.html>


More information about the x3d-public mailing list