question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript custom transformer for SSR

See original GitHub issue

🚀 Feature Proposal

Hi. Thanks for this great tool.

Do you have any plan to provide a TypeScript custom transformer such as @loadable/babel-plugin ?

Motivation

I’m working with a project using React/SSR/TypeScript. So we use not babel-loader but ts-loader with webpack. We’re considering to introduce loadable-components but we don’t want install Babel tools.

Example

/* webpack.config.js */
const loadableComponentsTransformer = require('@loadable/ts-transformer');

module.exports = {
    ...
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          exclude: /node_modules/,
          loader: "ts-loader",
          options: {
            getCustomTransformers: () => ({ before: [loadableComponentsTransformer] }),
          },
        },
      ],
    },
    ...
};

See also https://github.com/TypeStrong/ts-loader#getcustomtransformers--program-program---before-transformerfactory-after-transformerfactory-- .

Pitch

Why does this feature belong in the Loadable Component ecosystem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:58

github_iconTop GitHub Comments

7reactions
Quramycommented, Jan 14, 2020
3reactions
dagda1commented, Mar 12, 2020

@theKashey @Quramy I just blogged about this here for logrocket

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing TypeScript custom AST Transformer (Part 1)
The TypeScript compiler, on the other hand, is designed to be a battery-included monolith that works great out of the box and thus,...
Read more >
use React-typescript with custom typescript transformers ...
I have a typescript transformer I regularly use in the backend (Nodejs typescript), and I want to use it in the frontend too...
Read more >
Server-Side Rendering - tRPC
To enable SSR just set ssr: true in your createTRPCNext config callback. ... Set custom request headers on every request from tRPC.
Read more >
Nuxt SSR: transfer Typescript class instances
Hey there!. In this article, I will teach you how to transfer class instances through Server Side Rendering in Nuxt.
Read more >
Do you know how Angular transforms your code? - inDepth.dev
Angular widely uses typescript custom transformers. It might be useless to know what they do if you are not interested in Angular internals....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found