Skip to content

chore: remove underscore, replace with native JS; drop reactfire#38

Merged
ProLoser merged 1 commit into
mainfrom
copilot/update-dependencies-remove-unused
Jun 12, 2026
Merged

chore: remove underscore, replace with native JS; drop reactfire#38
ProLoser merged 1 commit into
mainfrom
copilot/update-dependencies-remove-unused

Conversation

Copilot AI commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the underscore library and replaces all usages with native evergreen JS equivalents. Also removes reactfire which was causing a peer dependency conflict and was not imported anywhere in the codebase.

Changes

package.json

  • Removed underscore from dependencies
  • Removed reactfire from dependencies (not used in source, was causing firebase peer dep conflict blocking npm install)

script.jsx

  • _.each(obj, fn)Object.entries(obj).forEach(fn)
  • _.keys(obj).lengthObject.keys(obj).length
  • _.findWhere(items, {type})Array.from(items).find()
  • _.each(_.uniq(_.map(_.pluck(_.where(...))))) chain → Object.values().filter().map() + new Set() + .forEach()

app.js

  • _.findWhereArray.from().find()
  • _.uniqSet-based deduplication

index.html

  • Removed underscore CDN <script> tag

cache.manifest

  • Removed underscore CDN entry

Testing

All 62 existing tests pass.

Copilot AI requested a review from ProLoser June 12, 2026 22:41
@ProLoser ProLoser marked this pull request as ready for review June 12, 2026 22:43
@ProLoser ProLoser requested a review from Copilot June 12, 2026 22:43
@ProLoser ProLoser merged commit 6087d8d into main Jun 12, 2026
2 checks passed
@ProLoser ProLoser deleted the copilot/update-dependencies-remove-unused branch June 12, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the underscore dependency by replacing its usages with native JavaScript equivalents, and drops the unused reactfire npm dependency to resolve peer dependency conflicts during installation.

Changes:

  • Replaced underscore helpers in script.jsx and app.js with native JS (Object.keys/values/entries, Array.from().find(), Set-based dedupe).
  • Removed underscore (and its CDN/cache entries) and removed reactfire from package.json.
  • Regenerated yarn.lock to reflect dependency graph changes.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
yarn.lock Updated lockfile reflecting removal of underscore/reactfire and related resolution churn.
script.jsx Replaced underscore iteration/query utilities with native JS equivalents.
app.js Replaced underscore usage in paste handling and uniqueness filtering with native JS.
package.json Removed underscore and reactfire from dependencies.
index.html Removed the underscore CDN script tag.
cache.manifest Removed the underscore CDN entry from the app cache manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script.jsx
Comment on lines 414 to 418
// Strip formatting on paste
var tempDiv = document.createElement("DIV");
var item = _.findWhere(e.clipboardData.items, { type: 'text/plain' });
var item = Array.from(e.clipboardData.items).find(function(i) { return i.type === 'text/plain'; });
item.getAsString(function (value) {
tempDiv.innerHTML = value;
Comment thread app.js
Comment on lines 261 to 266
// Strip formatting on paste
var pasteBinding = $element.on('paste', function (e) {
var tempDiv = document.createElement("DIV");
var item = _.findWhere(e.clipboardData.items, { type: 'text/plain' });
var item = Array.from(e.clipboardData.items).find(function(i) { return i.type === 'text/plain'; });
item.getAsString(function (value) {
tempDiv.innerHTML = value;
Comment thread app.js
Comment on lines 322 to +326
app.filter('unique', function(){
return function(data){
return _.uniq(data, false, function(row){
return row && row.text && row.text.toUpperCase();
var seen = new Set();
return data.filter(function(row) {
var key = row && row.text && row.text.toUpperCase();
Comment thread index.html
Comment on lines 7 to 10
<!-- Libraries loaded from CDN -->
<script src="https://cdn.jsdelivr.net/npm/underscore@1.13.7/underscore-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/react@0.12.2/dist/react-with-addons.min.js"></script>
<script src="https://cdn.firebase.com/js/client/1.1.3/firebase.js"></script>
<script src="https://cdn.jsdelivr.net/npm/reactfire@0.4.0/dist/reactfire.min.js"></script>
Comment thread script.jsx
var previous, previousIndex;
fb.update({firstLine: '0'});
_.each(snapshot.val().lines, function(line, index) {
Object.entries(snapshot.val().lines).forEach(function([index, line]) {
Comment thread script.jsx

window.onunload = (function(){
if (_.keys(this.state.script.lines).length <= 2)
if (Object.keys(this.state.script.lines).length <= 2)
Comment thread script.jsx
return character && character.toUpperCase();
})), function(character){
[...new Set(
Object.values(this.state.script.lines)
@ProLoser

Copy link
Copy Markdown
Owner

@copilot address the review feedback in a new PR off of the latest main or master branch

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.

3 participants