Fixes #39137 - TypeScript support for the frontend#10899
Fixes #39137 - TypeScript support for the frontend#10899Thorben-D wants to merge 1 commit intotheforeman:developfrom
Conversation
This commit adapts the Webpack config to allow compilation of .ts/.tsx files by Webpack. - Added packages: - typescript: 5.8.2 - ts-loader: 9.5.2 - Use ts-loader to load .ts/.tsx files during webpack compilation - Use plugin specific tsconfig.json file during compilation - Override module resolution of tsconfig.json from webpack config
|
rpm build fails because the typescript packages are not packaged yet: Here is the accompanying packaging PR: |
| @@ -5,7 +5,7 @@ begin | |||
| require "gettext_i18n_rails_js/task" | |||
| require File.expand_path('../../lib/foreman/gettext/support.rb', __dir__) | |||
|
|
|||
| FILE_GLOB = '{app,db/seeds.d,lib,config,locale,webpack}/**/*.{rb,erb,haml,slim,rhtml,js,rabl}' | |||
| FILE_GLOB = '{app,db/seeds.d,lib,config,locale,webpack}/**/*.{rb,erb,haml,slim,rhtml,js,tsx,rabl}' | |||
There was a problem hiding this comment.
Why for javascript we look at .js, but not .jsx and for typescript we look at .tsx but not .ts?
There was a problem hiding this comment.
TypeScript requires the .tsx extension for files that use JSX syntax, whereas for JavaScript it doesn't really matter.
I'll add .ts in case someone wants to use translation in a helper or something like that.
2aa92e4 to
f5f2b41
Compare
|
@Thorben-D Now that the packages are merged, can you please rebase your PR |
f5f2b41 to
a4c7c1a
Compare
|
I'd like to note that we're now in the Stabilization Week phase. Please consider whether you want to merge this PR before or after branching. Ref: https://community.theforeman.org/t/foreman-3-19-schedule-and-planning/45747 |
@ogajduse We are not in a hurry to merge this, so we can wait after branching. I don't expect anything to break because of this, though. However, it is good to see the pipeline turning green :) |
This commit adapts the Webpack config to allow compilation of .ts/.tsx files by Webpack.
This is the accompanying Pull-Request to the RFC in the community forum.