[Dove] Drop reliance on legacy runtime compatibility settings
See original GitHub issueRunning the Quick Start with typescript defaults returns the following error when executed with tsc app.ts
unless a tsconfig file is made and a handful of legacy compatibility features are turned on.
SyntaxError: The requested module '@feathersjs/koa' does not provide an export named 'bodyParser'
Reproduction: https://stackblitz.com/edit/node-lzf6x8?file=package.json,app.ts
Upon some debugging, body parser is not exported at top level… but in a property called default:
❯ tsx
Welcome to tsx v3.9.0 (Node.js v16.14.2).
Type ".help" for more information.
> import('@feathersjs/koa').then(console.log)
Promise { <unknown> }
> [Module: null prototype] {
default: {
Koa: [Getter],
bodyParser: [Getter],
koa: [Function: koa],
parseAuthentication: [Getter],
authenticate: [Getter],
errorHandler: [Getter],
formatter: [Getter],
rest: [Getter]
},
__esModule: true,
koa: [Function: koa],
authenticate: [Function: authenticate],
parseAuthentication: [Function: parseAuthentication],
errorHandler: [Function: errorHandler],
rest: [Function: rest],
formatter: [Function: formatter]
}
Proposed Solutions:
- Use tsup to automatically wrap the typescript modules for cjs and esm import.
- Drop support for CommonJs projects in new versions and only build for ES modules
Workarounds
- Using esno
- manually pick and hunt for dependencies within the CJS package
Additional Notes
- While TS 4.7 supports loading modules with Node natively, Vite does not. https://github.com/vitejs/vite/issues/8993#issuecomment-1247334167
- This causes problems when using build plugins as it’s hard to get everyone to agree without support for Node’s native behavior.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Support Typescript 4.7 "Node16" extension requirements #8993
Runtime or Buildtime? This is going the Deno route, of requiring extensions in the imports, which always irked me, but I can learn....
Read more >RPi - River Thames Conditions - Environment Agency - GOV.UK
Pre pro bono fellowship, Windows 8 compatible printers wireless? ... #Michel ordeman haarlem, Css based drop down list, The batter official ending, ...
Read more >50bfl2114_12_dfu_ita.pdf - User Manual
consiglia di selezionare l'opzione Professional mode ... Per sapere dove inserire il codice PIN nel software ... C runtime library.
Read more >AIX V6 Advanced Security Features - IBM Redbooks
1.8 Trusting the configuration of the OS with AIX Security Expert . ... the accuracy of performance, compatibility or any other claims related...
Read more >Tech Trends 2019 - Deloitte
a mean-spirited worm called Stuxnet was changing the rules of ... modernizing legacy core systems, transforming the business of technology, and.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This looks like providing an ESM build which we’ve been trying to do in https://github.com/feathersjs/feathers/pull/2665 can’t seem to get it working properly in an at least somewhat backwards compatible way. I’d be happy if someone wants to take on digging more into this.
A mail forwarding a dress would have saved a lot of time… Nothing hinted at work being done on somewhere else, there are dove branches there. A mail forwarding address would be nice 😉, even months before you move.
Vuetify is full of heads up notices… even though there is no stable up to date version, 20 months after Vue 3 became stable.
The repo, issue tickets and PR system need not be altogether… Those can be moved to the monorepo before this one is ready…