I've used `tsc --watch` as an almost-no-build-step way to write plain TypeScript with better structure (separate files, etc) for projects where dependencies aren't necessary, which works reasonably well with a few quirks, but I wish there were something more purpose-built for the task. TypeScript running natively in the browser would be amazing but I doubt that'll ever happen.
I wonder how far fetched it would be to have just the syntax of Typescript on the browser without type-checking. We'd have to use tsc locally only for the typechecking, without the need of a build process, but that would be enough for me. I know there's JSDoc but the normal syntax is so much better. EDIT: Looks like there's a proposal: https://github.com/tc39/proposal-type-annotations
Writing JavaScript without a build system
61–70 of 187 posts
Re: Writing JavaScript without a build system
#62A lightning rod of an idea I’m sure, but would it help if typescript was accepted by browsers but ignored? Then I can write my typings in-line rather than in comments, and check them, but not have to transpile. I guess “enum” as a special snowflake would fail this. Where I’m coming from is that I can live without most build steps for a small project… but I can’t live without typescript.
Re: Writing JavaScript without a build system
#63Re: Writing JavaScript without a build system
#64Getting older projects to run was a huge pain for me when I started working with JavaScript, but I have found two easy steps to get around this: 1. Use nvm + an .nvmrc file in your project to pin the major version of Node.js you are using. I recently got a five year old Node 8 project up and running with no issues using this method. 2. Try to avoid packages that has binary dependencies (like node-sass). 99% of binary…
Re: Writing JavaScript without a build system
#65Re: Writing JavaScript without a build system
#66If anyone's looking for something like a framework that works with buildless workflows you might check out the project I work on: Lit ( https://lit.dev ) Lit gives you reactive components, declarative HTML templates, runtime encapsulated DOM and styles, interoperability with frameworks and HTML via web components, and a lot more - with no required build tools at all. We take great care to make sure our libraries are…
Re: Writing JavaScript without a build system
#67Use npm to install libraries one time only. Try to use as few dependencies as possible. You don't need a framework--components are achievable without vue and react etc. Server side rendering and VDom are really not needed for most projects. Think of Programming in JavaScript, CSS and F5 rather than Typescript and SASS as the equivalent of Marcus Aurelius' Stoicism.
JavaScript and CSS are to Stoicism as Typescript and SASS are to _____?
Re: Writing JavaScript without a build system
#68I wonder how hard it would be for Browsers to natively strip TypeScript syntax from the .ts files without checking and run them as .js
Re: Writing JavaScript without a build system
#69I wonder how hard it would be for Browsers to natively strip TypeScript syntax from the .ts files without checking and run them as .js
Re: Writing JavaScript without a build system
#70If anyone's looking for something like a framework that works with buildless workflows you might check out the project I work on: Lit ( https://lit.dev ) Lit gives you reactive components, declarative HTML templates, runtime encapsulated DOM and styles, interoperability with frameworks and HTML via web components, and a lot more - with no required build tools at all. We take great care to make sure our libraries are…
We were embedding the component into a legacy application and needed to use a build tool for older browser compatibility but it was a breeze to work with even with the extra complication our build setup added.
Getting back to basics and targeting what most modern browsers support out of the box is a huge plus.