-
Notifications
You must be signed in to change notification settings - Fork 396
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
Typescript poc #3334
Typescript poc #3334
Conversation
- rewrite utils/cleanCss in ts for test purpose
Just wanted to say that I think that a gradual move to ts is a great idea. There are some really chewy parts of ractive that will probably fight typing pretty hard, but it can probably be persuaded. I think it may help to modernize the build system a bit too, since gobble is no longer developed and likely stuck at node 8. It's great to see a pr open up here! Let me know if you have any questions about the wild and wooly code base. I'd be happy to chat, and I'll try to lend a hand if you'd like when my schedule opens up a bit. |
inline functions in the file have been converted to private static functions
…ptions,html,hyphenateCamel,id} to ts
5758c80
to
533b3d6
Compare
- use spread operator in configuration files - gobble - karma - add --quite flag on lint:all task to avoid any related warnings
Hi @evs-chris, refactor is nearly complete but there are some points that I would like to bring to your attention: General information
Improvements To-Do
Do you want to procede with a merge to a 2.x branch or would you like to make some adjustments? |
Hi everyone, just as a FYI, next week I'm planning to run a few tests using a build of this branch on a pretty complex web-app. I'll report back next week! |
Nice! I think this would be a good opportunity to start a 2.x branch. I personally think a factory may be a better pattern than a class, but I'm not positive. Going into 2.0, we have the opportunity to adjust some things. @marcalexiei would you like to be added as a maintainer? On a somewhat related topic, I cleaned up the rollup-plugin-ractive-bin project a bit last week, and it now integrates much more cleanly with the typescript rollup plugin. What do you usually use to build your projects? |
Yes, I imagine that there is some way to combine factory pattern and types.
Yes. Thank you 😊
I use webpack with a custom HTML loader which parse HTML into a template object (basically a fork from official webpack-html-loader).
|
Hi @evs-chris, do you want to make other adjustments before merging into a new branch? Just re-checking 😀 |
I'm having a few issues while using the runtime.js bundle of Ractive. I'll check them out with @marcalexiei and report back. |
No, I think we should probably go ahead and merge this into the new 2.0 branch and carry on from there! |
e17dd55
to
c239a14
Compare
- fix spelling of Bracked in Bracket - improve extractRefs signature
- add markdownlint to validate md files - validation is performed via vscode extension - fix md files to meet markdownlint rules - remove unused jsconfig.json
c239a14
to
9e291b8
Compare
As a next step I will try to remove as many "any" as possible from the source code. |
Description:
Hi Chris,
We (@marcalexiei & @giovannipiller) have been thinking to contribute a bit to the project and had a couple of ideas.
Convert Ractive to Typescript
As suggested in #3172. This could help a lot while refactoring the code or hunting for bugs.
From our initial tests it looks like having a project which mixes JS and TS is possible, which should make things easier for us. We only noticed problems when importing JS from a TS file, but not the other way around.
Automate generation of API documentation
Documentation seems to be kind of an issue.
Storing part of it alongside the code should make it easier to maintain, reduce duplication and avoid inconsistencies (ex. changing a type in the code should also update the doc)
We’ve set up this PR to start some progress and gather some discussion.
To generate the documentation:
npm i
npm run doc
As a proof of concept, we added some content for
Ractive.prototype.toHTML()
method andRactive.prototype.observe
, which will be found in the following paths:Is breaking:
Nothing, but it's a WIP