5 ms·
It's immediately clear from the very first few lines of the PR that they're sacrificing safety for this. Before: import { Node } from 'acorn'; import
by bilalq 3y ago
It's immediately clear from the very first few lines of the PR that they're sacrificing safety for this.
Before:
import { Node } from 'acorn';
import * as code_red from 'code-red';
export const parse = (source: string): Node =>
code_red.parse(source, {
sourceType: 'module',
ecmaVersion: 13,
locations: true
});
After:
import * as code_red from 'code-red';
/**
* @param {string} source
* @returns {any}
*/
export const parse = (source) =>
code_red.parse(source, {
sourceType: 'module',
ecmaVersion: 13,
locations: true
});
But I'm not a Svelte maintainer or user, so if this is their choice, I guess it is what it is. It's not something I'd ever consider. There are other approaches for making linked npm package workflows more manageable. There's the one mentioned by one of the VSCode maintainer, but the simplest setup is to just have a watch process running that recompiles on the fly.
- rich_harris 3y agoYou are making judgements based on a draft PR. There is a ton of work still to do.
- bilalq 3y agoFair enough! I'd love to read a blog post about this after you finish the work. EDIT: It'd be a great outcome in the end if this conversion spurs DX improvements in Node/TS.
- Rapzid 3y ago> There is a ton of work still to do. What's the estimated ROI?
- postalrat 3y agoThat depends on how much you value getting a bunch of developers to think about svelte, jsdoc, and typescript.
- myvoiceismypass 3y agoMaybe I am unfamiliar with jsdoc, or what the shape of Node from acorn is, but yeah if every function is returning any, that seems like a big downgrade and sacrifice.
- _gruntled 3y agoWe're using an automated tool to do the gross conversion, then combing through fixing the issues. There's a reason the PR's a draft, dammit! :lol: Don't worry, _no_ type-safety will be lost, internally or externally.
- bilalq 3y agoFair enough. Minor nit, the PR is not actually marked as a draft.