Giter VIP home page Giter VIP logo

Comments (8)

Pessimistress avatar Pessimistress commented on May 29, 2024 2

https://github.com/visgl/deck.gl/blob/x/esm/tsconfig.module.json

from luma.gl.

donmccurdy avatar donmccurdy commented on May 29, 2024

Also -- the fix above should be fully backwards-compatible, so there's no problem with making that change in v9.1 instead of v9.0 if we prefer.

from luma.gl.

ibgreen avatar ibgreen commented on May 29, 2024

In loaders.gl we run a script call add-js-to-imports

#/bin/sh

echo '# Adding .js to import statements in dist folders'
find modules/*/dist -name "*.js" -exec sed -i '' "s/from '\.\(.*\)';/from '.\1.js';/" {} \;
find modules/*/dist -name "*.js" -exec sed -i '' "s/from '\.\(.*\)\.js\.js';/from '.\1';/" {} \;

from luma.gl.

donmccurdy avatar donmccurdy commented on May 29, 2024

That looks like a good solution to me, and definitely less churn than changing all source imports. Potentially then, we'd put something like that in each repository? It doesn't seem like that script is running in loaders.gl now, I don't see it called anywhere, and the suffixes are missing from published types –

https://unpkg.com/@loaders.gl/[email protected]/dist/index.d.ts

from luma.gl.

donmccurdy avatar donmccurdy commented on May 29, 2024

It seems this affects node16 module resolution in typescript, and not just nodenext. This section of the TS docs was helpful for me:

https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext-1

from luma.gl.

ibgreen avatar ibgreen commented on May 29, 2024

@Pessimistress

There is a need of adding explicit .js extensions to import statements in generated code as required by Node ESM?

Does the new ocular setup have a plugin to do this (I was assuming one of the plugins you used in the last PR did this), or do we need to add back post processing scripts?

from luma.gl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.