Skip to content
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

feat(datalog-console): add datalog-console #91

Merged
merged 7 commits into from
May 13, 2021

Conversation

groundedsage
Copy link
Collaborator

PR Description

Adds a way to signal that a Datalog DB is available to the Chrome extension.
Adds a listener to receive a request for the database as a string and send it as a string to the Chrome extension.

PR Checklist

Testing

  • added relevant test coverage
  • no tests needed

Docs

Typescript

  • added or edited relevant Typescript type declarations
  • no type declaration updates needed

Merging

For maintainers.

To merge, select "Squash and Merge". Then:

  1. Make sure the top commit message follows Angular Git Commit Guidelines,
  2. Delete all other commit messages in the description, but keep any lines designating co-authors so contributors will retain credit for their contributions.

@vercel
Copy link

vercel bot commented Apr 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

homebase-example-counter – ./examples/counter

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-counter/2udf3qRiwRS1GrTtM2HwTJTKQZs5
✅ Preview: https://homebase-examp-git-datalog-console-integration-hom-45f877.vercel.app

homebase-example-todo – ./examples/todo

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-todo/5DFoJQiNSWQraS8qEXnvTdeBrU3h
✅ Preview: https://homebase-examp-git-datalog-console-integration-hom-92d48a.vercel.app

homebase-example-ts-firebase-todo – ./examples/typescript-firebase-todo

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-ts-firebase-todo/8MEgNH3qMxibVYpMSSEU8wPwmTJB
✅ Preview: https://homebase-examp-git-datalog-console-integration-hom-5c24c9.vercel.app

homebase-example-roam – ./examples/roam

🔍 Inspect: https://vercel.com/homebaseio/homebase-example-roam/81UGut9juHQbZkxXUmqvzhH5azm6
✅ Preview: https://homebase-examp-git-datalog-console-integration-hom-55da2b.vercel.app

@becomingbabyman becomingbabyman added the enhancement New feature or request label May 1, 2021
(:require [goog.object :as gobj]
[cljs.reader]))

(js/document.documentElement.setAttribute "__datalog-inspect-remote-installed__" true)
Copy link
Member

Choose a reason for hiding this comment

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

":datalog-console.remote/installed?"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems that these special characters are not allowed as an attribute on html document. Changed it to "datalog-console-remote-installed"


(js/document.documentElement.setAttribute "__datalog-inspect-remote-installed__" true)

(defn init-datalog-console
Copy link
Member

Choose a reason for hiding this comment

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

rename to init!

@@ -7,7 +7,10 @@
[clojure.set]
[homebase.js :as hbjs]
[datascript.core :as d]
[datascript.impl.entity :as de]))
[datascript.impl.entity :as de]
[homebase.datalog-console :as console]))
Copy link
Member

Choose a reason for hiding this comment

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

:as datalog-console

@@ -134,6 +137,7 @@
conn (d/create-conn (if schema
(merge (hbjs/js->schema schema) base-schema)
base-schema))]
(console/init-datalog-console {:conn conn}) ; initialise listener for datalog admin console
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the comment is needed. The naming is clear enough

@becomingbabyman becomingbabyman merged commit e5584da into master May 13, 2021
@becomingbabyman becomingbabyman deleted the datalog-console-integration branch May 13, 2021 16:14
@github-actions
Copy link

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

(:require [goog.object :as gobj]
[cljs.reader]))

(js/document.documentElement.setAttribute "__datalog-console-remote-installed__" true)
Copy link
Contributor

Choose a reason for hiding this comment

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

@groundedsage it looks like this breaks Next.js support for HBR with the following error:

error - ReferenceError: document is not defined
    at /Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:1491:479
    at /Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:6:22
    at Object.<anonymous> (/Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:10:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at eval (webpack-internal:///homebase-react:1:18)
Installing CLJS DevTools 1.0.2 and enabling features :formatters :hints :async
ReferenceError: document is not defined
    at /Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:1491:479
    at /Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:6:22
    at Object.<anonymous> (/Users/jb/repos/supabase-js/example/next-todo/node_modules/homebase-react/dist/js/homebase.react.js:10:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at eval (webpack-internal:///homebase-react:1:18)
CLJS DevTools: some custom formatters were not rendered.
https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#why-some-custom-formatters-were-not-rendered
CLJS DevTools: some custom formatters were not rendered.
https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#why-some-custom-formatters-were-not-rendered

Can you please do error catching here and make it a warning when it fails vs breaking compilation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants