Open Mister-Hope opened 1 year ago
Convert user_id to userId for comment data structure, to have a constant key named rule with camelCase.
What's the purpose of this? CamelCase is not friendly for SQL like storage service, I have headache to some camelCase fields already.
To unify data structrure, all other keys are camelcase like insertedAt
objectId
etc (or in another word, this is the only kebab_case key in client package and whole api.
If you do think it's not ok for changing this key, I still suggest making a convertion to camelCase in server for this key before returning data to client. We have 3rd party clients, and it's better for us to provide a unified data structure, and more easy-understanding apis. We could remain old apis.
To unify data structrure, all other keys are camelcase like
insertedAt
objectId
etc (or in another word, this is the only kebab_case key in client package and whole api.If you do think it's not ok for changing this key, I still suggest making a convertion to camelCase in server for this key before returning data to client. We have 3rd party clients, and it's better for us to provide a unified data structure, and more easy-understanding apis. We could remain old apis.
Any ideas with this one? Technically speaking, I think it's better for us to provide new apis while remaining the old one. @lizheming
Also I would like to work on v3 for the above changes.
the server's demo page '/' is still using the old API!
The issue record breaking changes to be made in next major version.
We may need a migration helper to convert database into the new format.
Migration helper rebuild
Improve migration helper, since we will drop any direct compatibility with valine or waline/client@v1, currect migration helper shall be increased. It's important for us to provide smooth migration from older versions
New migration helper should have a customizable middleware which contains the following features:
[ ] Ensure all comments is in html format.
Comments before 2021 and comments from valine may still have markdown stored. We should provide a check box to guess if a content is markdown.
[ ] Provide a
emojiCDN
optionMigration helper shall try to apending any img tag matching emojiCDN with class
wl-emoji
.Migration helper shall convert any img tag with calss
vemoji
towl-emoji
.[ ] Update comment reply
Migration helper to remove exisiting reply prefix in comment
[ ] Convert
user_id
touserId
for comment data structure, to have a constant key named rule with camelCase.Change reply @ into client
https://github.com/walinejs/waline/issues/1649
This requires:
Data struture update
Update the remaining 2 kebab_case key in data:
user_id
touserId
for comment data structuredisplay_name
tonickname
for user info[ ] Client
[ ] Server
New API replacing old ones
[x]
/comment?type=count&url=URL
will return inconstant data type, and new API should returnnumber[]
, so should/article?type=time
[x]
/article
api has too complicated results, based on URL params, it may have result type:New forceLogin
We can provide a login requirement for all apis, this requires:
login=force
Remove legacy package
Treeshakble widgets
In v3, widgets no longer exisit in widgets, instead they are exported directly so that they can be tree-shakable.
Remove exports
To reduce client size, we no longer output src folder in v3, also we canel shortcut exports key starting with dist.