Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tsconfig) added isolated modules flag and fixed types exports #410

Merged
merged 0 commits into from
Apr 11, 2022

Conversation

kociolekscramjet
Copy link
Contributor

Two main issues at babel-loader and ts-loader regarding this task babel/babel-loader#603 TypeStrong/ts-loader#751

To summarize ts-loader works with transpileOnly option which essentially is --isolatedModules. That means ts-loader do not know which re-exported element is type and which is not.

There are workarouns for this.

  1. Turn off config.module.strictExportPresence and supress warnings with
     messages = formatWebpackMessages(
          stats.toJson({
            (...)
            warningsFilter: [
              /export .* was not found in/
            ]
          })
        );
  1. Or use more precise re-exports (without the *) for example

BAD:

export * from "./a";

GOOD:

import { T } from "./a";
export type T = T;

For now trying second approach with
export type instead of export

@kociolekscramjet kociolekscramjet marked this pull request as draft April 7, 2022 22:32
@scramjet-bot
Copy link

Task linked: SCP-3507 [GUI] Change backend types import

@jan-warchol jan-warchol changed the base branch from release/0.19 to devel April 11, 2022 08:26
@kociolekscramjet kociolekscramjet changed the base branch from devel to patch/mw-apic-browser-format April 11, 2022 11:46
@kociolekscramjet kociolekscramjet marked this pull request as ready for review April 11, 2022 11:51
@patuwwy patuwwy merged this pull request into patch/mw-apic-browser-format Apr 11, 2022
@patuwwy patuwwy deleted the feat/types-for-frontend branch April 11, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants