-
Notifications
You must be signed in to change notification settings - Fork 452
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
Upgrade rich-text and rich-text-presence example to Quill 2.0.2 #683
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for the contribution! Some notes mostly on keeping things minimalist
examples/rich-text/package.json
Outdated
"express": "^4.18.2", | ||
"quill": "^1.3.7", | ||
"quill": "^2.0.2", | ||
"quill-cursors": "^4.0.2", |
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.
Not used in this example
examples/rich-text/package.json
Outdated
@@ -15,14 +15,20 @@ | |||
"license": "MIT", | |||
"dependencies": { | |||
"@teamwork/websocket-json-stream": "^2.0.0", | |||
"bson-objectid": "^2.0.4", |
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.
Not used in this example
examples/rich-text/package.json
Outdated
"@babel/core": "^7.25.7", | ||
"@babel/preset-env": "^7.25.7", | ||
"babel-loader": "^9.2.1", |
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.
Do we need these? I think if you remove babel
from the Webpack config, everything still runs (in a modern browser). If possible, let's keep these examples as bare-bones as possible (it's not within the scope of this library to inform consumers how to set up their build chain).
Similar comment applies for rich-text-presence
.
examples/rich-text/webpack.config.js
Outdated
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['@babel/preset-env'] | ||
} | ||
} | ||
} | ||
] | ||
}, |
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.
As noted above, I don't think this is needed. Let's remove to keep as minimalist as possible.
theme: 'bubble', | ||
modules: {cursors: true} | ||
var quill = new Quill('#editor', { | ||
theme: 'snow', |
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.
Any reason in particular for changing the theme?
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.
The theme has a toolbar. It is easier to test behavior cursor and the toolbar interactions with it.
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 guess it doesn't matter which theme we use, but if you need to do any particularly in-depth testing with cursors and toolbar interaction, that should really be a concern of quill-cursors
.
@alecgibson Thanks for the idea to KISS it. Babel removed. |
theme: 'bubble', | ||
modules: {cursors: true} | ||
var quill = new Quill('#editor', { | ||
theme: 'snow', |
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 guess it doesn't matter which theme we use, but if you need to do any particularly in-depth testing with cursors and toolbar interaction, that should really be a concern of quill-cursors
.
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
} | ||
] | ||
}, |
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.
As I said before, this isn't needed.
Please remove.
resolve: { | ||
extensions: ['.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.
You actually also don't need this.
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['@babel/preset-env'] | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['.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.
As above: unneeded; please remove
@@ -3,6 +3,7 @@ | |||
<title>ShareDB Rich Text</title> | |||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> | |||
<link href="quill.bubble.css" rel="stylesheet"> | |||
<link href="quill.snow.css" rel="stylesheet"> |
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.
If you're changing theme here, please remove bubble.css
"@babel/core": "^7.25.7", | ||
"@babel/preset-env": "^7.25.7", | ||
"babel-loader": "^9.2.1", |
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.
Unneeded.
This pull request includes several updates to the
examples/rich-text-presence
project, specifically to support Quill 2.0.2 and modernizing the build process, updating dependencies, and improving the user interface.Watch: Demo
The most important changes are summarized below:
Modernization of Build Process:
package.json
to use Webpack for module bundling, replacing Browserify. Addedwebpack
andwebpack-cli
todevDependencies
, and included a newwebpack.config.js
file for configuration. (examples/rich-text-presence/package.json
,examples/rich-text-presence/webpack.config.js
) [1] [2] [3]Dependency Updates:
quill
dependency from version^1.3.7
to^2.0.2
inpackage.json
. (examples/rich-text-presence/package.json
)Codebase Improvements:
require
statements with ES6import
statements inclient.js
for better compatibility with modern JavaScript standards. (examples/rich-text-presence/client.js
)User Interface Enhancements:
snow
theme instead ofbubble
and added a toolbar module for enhanced editing capabilities. Correspondingly, added thequill.snow.css
stylesheet inindex.html
. (examples/rich-text-presence/client.js
,examples/rich-text-presence/static/index.html
) [1] [2]