-
Notifications
You must be signed in to change notification settings - Fork 52
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: make elderjs compat with a ts project #72
base: master
Are you sure you want to change the base?
feat: make elderjs compat with a ts project #72
Conversation
If the src/ directory files are .ts files elder should load them correctly. Removes use of hardcoded .js file extensions and relax to include check for .ts extension. With this change the developer no longer needs to point elder.config.js at the typescript build directory. As long as the build is executed via ts-node all modules will be transpiled to JS during execution. This will result in build times being slower to incorporate the ts compilation overhead. However overall it offers a big usability improvement for developers looking to work with elder.js and Typescript.
🖐️ Just saying I fully intend to pick this up again asap but will have low availability over the next week. More than happy if other folks would like to pick this up. |
@thisislawatts Enjoy the new addition to the family! 👍 Take your time. |
@thisislawatts if the remaining stuff is just fixing the build, LMK if you'd like to hand it off. I would like to contribute to Elder so it'd be a way to get started. |
Hey @hangtwenty please do have a look at this if you've got the time. I am not sure this is only an issue with the build. I imagine this branch is pretty stale at the moment. I will be picking things up again in January. |
|
||
const ssrFolder = settings.$$internal.ssrComponents; | ||
|
||
const ssrComponents = glob.sync(`${ssrFolder}/*.js`); | ||
|
||
const routejsFiles = files.filter((f) => f.endsWith('/route.js')); | ||
const routeJsRegex = /route.t|js$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const routeJsRegex = /route\./[tj]s$/;
really interested in getting this done, where can I help test or implement? |
I can also help test, Typescript support would be great. |
If the src/ directory files are .ts, elder should
load them correctly. Removes use of hardcoded .js file extensions
and relax to include check for .ts extension.
With this change the developer no longer needs to point elder.config.js
at the typescript build directory. As long as the build is executed
via ts-node all modules will be transpiled to JS during execution. This
will result in build times being slower to incorporate the ts compilation
overhead.
However overall it offers a big usability improvement for developers looking
to work with elder.js and Typescript.