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: make elderjs compat with a ts project #72

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

feat: make elderjs compat with a ts project #72

wants to merge 2 commits into from

Conversation

thisislawatts
Copy link
Contributor

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.

src/routes/routes.ts Outdated Show resolved Hide resolved
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.
@thisislawatts
Copy link
Contributor Author

🖐️ 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.

@nickreese
Copy link
Contributor

@thisislawatts Enjoy the new addition to the family! 👍 Take your time.

@floer32
Copy link

floer32 commented Dec 23, 2020

@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.

@thisislawatts
Copy link
Contributor Author

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.
Let me know if you start work on it! Would love to see this finished off 🙌


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$/;

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$/;

@ghost
Copy link

ghost commented Feb 12, 2021

really interested in getting this done, where can I help test or implement?

@michaeloliverx
Copy link

really interested in getting this done, where can I help test or implement?

I can also help test, Typescript support would be great.

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.

5 participants