Skip to content

[TS] Add option for removing typescript import flag using --ts-no-import-ext #7748

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

Merged
merged 2 commits into from
Jan 7, 2023
Merged

[TS] Add option for removing typescript import flag using --ts-no-import-ext #7748

merged 2 commits into from
Jan 7, 2023

Conversation

ink-su
Copy link
Contributor

@ink-su ink-su commented Dec 31, 2022

Add an flag --ts-no-import-ext to flatc to allow removing the import extension for typescript files.

  • If the flag is not specified, old behaviour is performed.
  • If ---ts-no-import-ext imports will not have the .js extension.

Added test using optional_scalars.fbs as the base.

  • Tests generating + compiling.

Fixes this issue which I also encountered in my NextJS project:
#7661

@github-actions github-actions bot added c++ codegen Involving generating code from schema javascript python typescript labels Dec 31, 2022
@dbaileychess
Copy link
Collaborator

@bjornharrtell for comment

@bjornharrtell
Copy link
Collaborator

I would like it so that this doesn't change current behavior, instead opt out of import extensions. Flag name should probably be including ts, so I would suggest ts-no-import-ext.

@github-actions github-actions bot removed the python label Jan 7, 2023
@ink-su ink-su changed the title [TS] Add option for typescript import file extension [TS] Add option for removing typescript import flag using --ts-no-import-ext Jan 7, 2023
@dbaileychess dbaileychess merged commit c2668fc into google:master Jan 7, 2023
@ink-su ink-su deleted the typescript-import-ext branch January 8, 2023 09:15
sunwen18 pushed a commit to sunwen18/flatbuffers that referenced this pull request Jan 9, 2023
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants