|
| 1 | +# Next-10 Types Mini-Summit |
| 2 | + |
| 3 | +## Links |
| 4 | + |
| 5 | +* Recording: <http://www.youtube.com/watch?v=HTbh6o6a-aI> |
| 6 | +* Issue: <https://github.com/nodejs/next-10/issues/149> |
| 7 | + |
| 8 | +## Attendees |
| 9 | + |
| 10 | +* Michael Dawson (@mhdawson) |
| 11 | +* Stephen Belanger(@qard) |
| 12 | +* Richard Lau (@richardlau) |
| 13 | +* Ethan Arrowood (@ethan-arrowood) |
| 14 | +* Gil Tayar (@giltayar) |
| 15 | +* Wesley Wigham (@weswigham) |
| 16 | +* Jacob Smith (@JakobJingleheimer) |
| 17 | +* OJ Kwon (@kwonoj) |
| 18 | +* Andrew Bradley (@cspotcode) |
| 19 | +* Guy Bedford (@guybedford) |
| 20 | +* Zack Schuster (@zackschuster) |
| 21 | +* DongYoon Kang (@kdy1) |
| 22 | +* Steven (@styfle) |
| 23 | +* Jake Bailey (@jakebailey) |
| 24 | +* Geoffrey Booth (@GeoffreyBooth) |
| 25 | +* Feng Yu (@F3n67u) |
| 26 | +* Ruy Adorno (@ruyadorno) |
| 27 | +* Fabian Meyer (@meyfa) |
| 28 | +* Romulo Cintra (@romulocintra) |
| 29 | +* Tierney Cyren (@bnb) |
| 30 | +* Matteo Collina (@mcollina) |
| 31 | +* Jean Burellier (@sheplu) |
| 32 | +* Moshe Atlow (@Molow) |
| 33 | +* Rob Palmer (@robpalme) |
| 34 | +* and 2-3 others |
| 35 | + |
| 36 | +## Agenda |
| 37 | + |
| 38 | +* Intro |
| 39 | +* Requirements/Desired UX Brainstorm |
| 40 | +* Document agreed approach |
| 41 | +* Implementation brainstorm (if time) |
| 42 | +* Document Next Steps (10 mins) |
| 43 | + |
| 44 | +## Requirements/Desired UX Brainstorm |
| 45 | + |
| 46 | +* Jacob |
| 47 | + * Today you can support TS using esloader with command line loader |
| 48 | +* Geoffrey shared steps you need to do using ts-node |
| 49 | +* Tierney believe goal is to run node test.ts |
| 50 | +* Michael, not bundling, but if required pieces already installed, then work, otherwise |
| 51 | + prompt to install pieces. |
| 52 | +* Jacob, how? |
| 53 | + * keep list of all options |
| 54 | + * pick one? |
| 55 | + * some config |
| 56 | +* Stephen - Suggestion of pushing things into NODE_OPTIONS does not work |
| 57 | +* Wesley - built in prompt, but then suggest you install |
| 58 | +* Geoffrey, specific design not to bundle TypeScript with Node.js |
| 59 | +* Geoffrey, we would have informative error message, go to this link to get info on |
| 60 | + options etc. |
| 61 | +* Zack - many different flavors of typescript? |
| 62 | +* Wes, check compiler options reference, many different ways to config |
| 63 | +* Zack, two core parts, |
| 64 | + * print something when test.ts is run with additional info |
| 65 | + * Lower config than NODE_OPTIONS in terms of what you can do today |
| 66 | +* Andrew, comes down to adding more comprehensive customization hooks |
| 67 | +* Jake - don’t want to get hung up on global list |
| 68 | +* Matteo |
| 69 | + * Current issue with some proposals - requirement for ESM,world is bigger than that, needs to work for both ESM and CJS |
| 70 | + * use of NODE_OPTIONS is not ergonomic |
| 71 | + * loading from package.json might be a good option |
| 72 | +* Tierney |
| 73 | + * Configuring through package.json is fine, but would be able to run node script.ts, |
| 74 | + happy to do steps required for project, but not have higher bar. |
| 75 | +* Andrew - mention of snippet implying ESM, work through hacks ts-node sample works for CJS |
| 76 | + as well |
| 77 | +* Matteo |
| 78 | + * Reason not recommended that can download node and then just run node script.ts. Issue |
| 79 | + is there are lots of different options |
| 80 | +* Stephen could we just not do the same as ts-node if we don’t use config file |
| 81 | +* Matteo, hook to guide people to setup config file. Deno does not support multiverse of |
| 82 | + TypeScript, we don’t want to do that. |
| 83 | +* Daniel, in terms of compatibility across versions, does Types as annotations relate in terms of |
| 84 | + Possibly being defaults? |
| 85 | +* Matteo, whatever happens at runtime level, does not relate, what’s being specified in TC39 |
| 86 | + proposal does not overlay, Types a comments is about TypeChecking, not running |
| 87 | +* Tierney, independent. |
| 88 | +* Ruy, discussed supporting different versions, maybe vendoring loaders might be a solution. |
| 89 | +* Rob, implemented in runtime in a custom runtime, on Matteo’s comment, found you can divide tsconfig into 2 categories |
| 90 | + * type checking - every project wants something different |
| 91 | + * adapting to platform - looking them down the way Deno does is beneficial as they don’t need |
| 92 | + to vary for a given runtime platform. Deno’s layered approach |
| 93 | + * core set you cannot override which are aligned with platform |
| 94 | + * other can be varied |
| 95 | + * Andrew, what do we do if user does not have config, its more just around running, editors |
| 96 | + highlight issues, etc. If we lock down options, what does the editor do if there is no config |
| 97 | + file for example? |
| 98 | +* Wes fundamentally all we want is ability to install something that has the ability to override |
| 99 | + Node.js execution start. |
| 100 | +* Tierney, don’t want to do it for anything, ok to limit it down to a limited subset, for now TypeScript |
| 101 | +* Jacob, don’t necessarily to need to limit subset, only if we can define a method that is agnostic |
| 102 | +* Geoffrey, perspective of maintainers, there are lots of decisions so choosing config etc. as |
| 103 | + Node.js maintainer, don’t have Node.js make decisions. Just enable people to load easily. |
| 104 | + This is first decision to make. |
| 105 | +* Andrew |
| 106 | + * Loaders to expand to be customization hooks |
| 107 | + * Option in on project local basis through package.json |
| 108 | + * Opt in on a global basis |
| 109 | + * Don’t violate security expectations |
| 110 | +* Geoffrey, loaders roadmap has a number of those on the roadmap, PR already open #43973 |
| 111 | +* Tieney, +1 being totally configurable, as long as it does not take a lot of energy to |
| 112 | + support that and DX is not awful, DX needs to be primary result. Could loader just not provide |
| 113 | + the configuration. |
| 114 | +* Jake, busy looking at snippet, talking about putting things in package.json. Do we not care |
| 115 | + about case where you don’t need a package. |
| 116 | +* Matteo, will need a config, other files |
| 117 | +* Geoffrey, you could run with ts-node as the binary |
| 118 | +* Jake, wanted to understand where line is drawn. |
| 119 | +* Tierney, concept of node.rc has been raised a number of times, for example saying that node |
| 120 | + will use loader X |
| 121 | +* Geoffrey - node just has one, flag, if config in package.json, should be able to put as much |
| 122 | + configuration into it. - often different configurations for different environments. |
| 123 | +* Wes, expectations that package.json is scoped, maybe you just want a rc file instead. |
| 124 | +* Geoffrey, if file is in scope of package.json, that package.json is used to start/run config, |
| 125 | + No other package.json take place. |
| 126 | +* Andrew, affects package typically, were most rc files, they are hierarchical, and combined |
| 127 | +* Stephen, tsconfig is not necessary related, defer that to whatever is configured |
| 128 | +* Matteo, we could consider that tsconfig is needed since without that it is sub-par experience |
| 129 | +* Andrew, some talk of mapping from file extensions, some cases where that might not work |
| 130 | +* Michael, more generally or for TypeScript, imports may not have a specifier at all, or |
| 131 | + package.json |
| 132 | +* Jake, other tools already do the prompt in terms of asking people to install required components. |
| 133 | +* Geoffrey if have example of doing the same prompts that would be useful. Please add to the issue. |
| 134 | +* Rob beneficial, for it to just work, not many people wanting to reconfigure loaders, if we |
| 135 | + can be opinionated, important for ecosystem coherence. |
| 136 | + |
| 137 | +## Agreement on DX |
| 138 | +1. start file with node (ex ndoe script.ts), look for config, not found echo message |
| 139 | + * generic |
| 140 | + * specific one for .ts |
| 141 | + * point to page on Node.js project with the instructions. |
| 142 | + |
| 143 | +2. start a file with node (ex node script.ts), find config file in scope, apply Node.js |
| 144 | + options specified before trying to run file |
| 145 | + * options will configure support for execution of file of that type (for example |
| 146 | + through loaders or some other mechanism) |
| 147 | + * package.json as config file is a good choice as we already look for it. |
| 148 | + * Need to support handling different environments/conditions like prod,dev, etc. |
| 149 | + |
| 150 | +Future/follow on discussion: |
| 151 | + |
| 152 | +* Can we provide more opinionated solutions in future. Some views that this adds more value. |
| 153 | +* When we support this how can we discourage people from shipping libraries that only contain |
| 154 | + TypeScript code, encourage pre-compilation. Feature may lead people into thinking just |
| 155 | + shipping TypeScript makes sense. Loaders can choose to not do node_modules. Can plan for |
| 156 | + users flow for pre-compiling. |
| 157 | + |
| 158 | +## Next Steps |
| 159 | + |
| 160 | +1. PR in minutes for summit (Michael) |
| 161 | +1. PR in agreement somewhere, to get broader collaborator input (Michael) |
| 162 | +1. PR in page with instructions on Nodejs.org |
| 163 | +1. PR in Node.js to return error with link to page |
| 164 | +1. Open discussion issue on nodejs/node for designing config approach (Geoffrey) |
| 165 | +1. PR to implement config design |
| 166 | +1. Update instructions on page from 2) to define config for getting `node script.ts` to run |
0 commit comments