5 ms·
> Imagine if Tailwind or Laravel forced you into funky .tailwind/.laravel named files because they felt a certain way about their name. > I took this as a sign
by shubhamjain 3y ago
> Imagine if Tailwind or Laravel forced you into funky .tailwind/.laravel named files because they felt a certain way about their name.
> I took this as a sign that Astro might become a very money hunger shark at the first drop of blood like other popular CMS providers have done in recent memory.
You’re reading way more than what’s reasonable. Vue, React, Svelte have their own file types. The reason has nothing to do with branding. Astro’s syntax is just different from anything that exists and having a dedicated file type makes sense.
- hoofhearted 3y agoWas .ts or .tsx not available or something?
- mrcwinn 3y agoThat would a very misleading choice. .astro files are not .ts or .tsx. Similar to .vue files, they have their own structure that needs to be interpreted.
- hoofhearted 3y ago.tsx would be a totally practical use for their files. Please explain why they needed to create their own style?
- chromakode 3y agoAstro files contain markup and separators which are not valid Typescript. They also have a different execution model.
- wruza 3y agoI just read the part about astro components and reasoning about “code fence”. How exactly do you propose to use .tsx files for their case? Specifically, how would you extract a template but run the rest of the code? I have some ideas, but they aren’t more practical than just splitting it across that fence.
- LocalH 3y ago.ts is the extension for MPEG-2 transport stream files, at the very least.
- hoofhearted 3y ago.ts = typescript file. Just a plain old dumb JavaScript file, but just written in the Typescript superset.
- a_wild_dandan 3y agoThe React library requires no custom file types, and doesn't have templates. Just import the React package into your pure JS project, and get crackin'. Just like jQuery. JSX is an optional extension of JavaScript which adds a few syntactic sugar features, e.g. writing `<FooComponent ...` instead of `const FooComponent = () => createElement(...`. It's completely distinct from templates in Vue or Svelte. This is crucial, because templates are a bad idea. As Steven Wittens[1] put it: > Many competing frameworks acted like this wasn't so, and stuck to the old practice of using templates. They missed the obvious lesson here: every templating language inevitably turns into a very poor programming language over time. It will grow to add conditionals, loops, scopes, macros, and other things that are much nicer in actual code. A templating language is mainly an inner platform effect. It targets a weird imagined archetype of someone who isn't allergic to code, but somehow isn't smart enough to work in a genuine programming language. In my experience, this archetype doesn't actually exist. Designers don't want to code at all, while coders want native expressiveness. It's just that simple. [1] https://acko.net/blog/get-in-zoomer-we-re-saving-react/ https://acko.net/blog/get-in-zoomer-we-re-saving-react/
- FireInsight 3y agoWell, not everything works or needs to work like that. Astro is not unique in using templates and it is rather justified in using them being a sort of next-gen SSG.