-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
js, templates: Replace contenteditable
div
with textarea
#887
Conversation
Hi @BBaoVanC, very nice effort, thank you! This is sorely needed. A couple thoughts of mine: We shouldn't add any external dependencies, instead vendor them in (the ES5-compatible version). We don't need e.g. (afaics!)
We should set the max length HTML5 attribute for textarea (and also email and website) The autosize FAQ suggests disabling blurs on Safari for textarea - good idea to add to the CSS. For yourself: Best to push proper commits already, that way you don't have so much explaining to do in the PR, you can just copy-paste from your commit messages. |
Thanks for the response @ix5 How would I vendor the dependencies like you said? I tried to search the repository for the word Also about the commit messages, I'll rebase it later once it's in less of a draft stage. And in this stage with all the changes I'm trying to do it's easier to just write down the changes I make in the PR description as I go instead of writing it on every commit. |
Just put the file into
Dw, just something I found useful for myself. |
78d9e11
to
96fdb5f
Compare
I decided that it's best to try and replace the "Edit" box with a postbox in a different PR. It would require a large refactor and I don't want to block this change for that long. As far as I can tell, editing indentation works fine in its current state. I removed the Also, I feel like this project could benefit from a lot of the client code being refactored and/or rewritten. I wonder if it would be worth using TypeScript? I'll play around with this a bit in a different branch on my fork. |
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.
I decided that it's best to try and replace the "Edit" box with a postbox in a different PR. It would require a large refactor and I don't want to block this change for that long. As far as I can tell, editing indentation works fine in its current state.
That's sensible, I agree.
I removed the
editorify()
test since that function isn't needed anymore, but for some reason the screenshots don't match the CI. Could also benefit from a couple tests, which I'll look into tomorrow, in addition to rebasing and adding toCHANGES.rst
.
Yeah, especially the comment.png
screenshot shouldn't change, it appears it changes height by 1px. Weird. Maybe some outline sizing gets transferred.
Also, I feel like this project could benefit from a lot of the client code being refactored and/or rewritten. I wonder if it would be worth using TypeScript? I'll play around with this a bit in a different branch on my fork.
If we decide to move to Typescript, we'd have to do a whole lot of other refactoring as well. I feel like the current state doesn't merit introducing types - it'd be like smearing lipstick on a pig. We'd also have a whole rat's tail of development dependencies to contend with. See #834 for some more of my thoughts on the topic. I'm not opposed, I just feel like it should be worth it. E.g. remark42's client code is extremely complicated and inaccessible (to me).
For refactoring the code, have a look at https://github.com/isso-comments/client-experimental - maybe we can collaborate a bit there, while keeping ES5 compatibility.
Edit: Please also see #890, I hope this makes the whole screenshot testing handling a bit easier to understand. Should I change anything to make it clearer/friendlier? Still figuring CI stuff out.
07e94c4
to
8dda393
Compare
I feel like this could be beneficial overall, since I'm a big fan of statically typed languages (it feels less awkward and overall more stable/definite to work in). Code is easier to follow with defined types. It looks like with TypeScript + Webpack, we would be able to write with modern syntax, but have it transpile to ES5 compatible output. We also don't have to completely refactor everything at once since, as far as I can tell regular JS code is completely valid in TS (just you don't get the compile-time error-checking that you do with TS). I'll look into your experimental client in a bit, but first: do we have some way to run the tests on the main Isso repo over here on the experimental client? I feel like that would be a nice way to make sure during development that the experimental client functions the same. Hopefully we could gradually add more tests, and if there's any unintended functionality on the main client which is discovered, it can be fixed.
I'm not too concerned about having dependencies, I feel that NPM is just sort of designed in a way that makes it hard to avoid having tons of packages/dependencies. As long as the ones we explicitly list in On this PR: tests seem to work except the integration one failed with a weird error:
But it worked fine on my own machine (I used similar steps to the E2E workflow on my system to update the screenshots). I did rebase this PR onto the latest master before updating screenshots again, but also I don't really see any changes in this PR that would break that.
Looks like the same error happened on the latest commit to master, so I guess it's not specific to this PR. |
416716a
to
d3dde2a
Compare
contenteditable
div
in Postbox with textarea
contenteditable
div
with textarea
0181526
to
ff848fe
Compare
The PR as it currently stands is done, as far as I can see. I know you'll fix the other issues we've talked about in a later PR. Re: Typescript etc: I'll open another issue for that so we can continue discussion there. |
Sounds good to me, I don't see anything else that needs to be changed either. |
New issue opened #894
TS sure looks like a nice addition, but we might also be limiting ourselves in the contributors we get - they'd have to know TS as well. This kind of feels a bit like the "sprinkle some async" fad in python to me. Maybe start with better test coverage and work from there?
You can simply swap out the JS part for the integration tests (copy the generated
Then run The repo also has its own unit tests (since too much has changed).
I'm already kind of annoyed at all the Javascript packages constantly jumping sub-revisions (e.g. |
83b59c6
to
e7cb904
Compare
Checklist
(If docs changes needed:) I have updated the documentation accordingly.N/A?CHANGES.rst
because this is a user-facing change or an important bugfixWhat changes does this Pull Request introduce?
contenteditable
div
with a propertextarea
- fix indentation bugsWhy is this necessary?
Fixes #465