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

Can6 upgrade #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Can6 upgrade #39

wants to merge 2 commits into from

Conversation

josh-bitovi
Copy link

@josh-bitovi josh-bitovi commented Nov 26, 2019

Unfinished.

Working towards upgrading DoneJS 6 to CanJS 6 (using this project to get DoneJS' dependencies ready).

DoneJS upgrade issue

Relevant PRs:

The current error is below. can-simple-dom will need to be upgraded to
support HTMLElement.

ReferenceError: HTMLElement is not defined
    at DeriveElement (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:48:38)
    at Object.<anonymous> (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:107:44)
    at file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:109:4
    at file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:109:98
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at doEval (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:4788:10)
    at __eval (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:4892:7)
    at Loader.exec [as __exec] (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:2896:5)
    at load.metadata.execute (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:3869:13)
(node:51397) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:51397) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Failed promise: TypeError: betweenTagsView is not a function
    at Constructor.setup (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-component/can-component.js:676:21)
    at Function.newInstance (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-construct/can-construct.js:307:22)
    at Constructor.init (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-construct/can-construct.js:662:29)
    at new Constructor (eval at <anonymous> (evalmachine.<anonymous>:93:58), <anonymous>:3:34)
    at eval (file:/Users/josh/projects/bitovi/oss/donejs-chat/src/app.js!eval:52:15)
    at /Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-zone/lib/tasks.js:167:15
    at Task.run (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-zone/lib/zone.js:39:17)
    at Zone.runTask (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-zone/lib/zone.js:184:14)
    at /Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-zone/lib/zone.js:285:15
    at /Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-zone/lib/tasks.js:178:21
@josh-bitovi
Copy link
Author

Notes:

  • The current error upon starting a server (`donejs develop`)
      Failed promise: { TypeError: Super expression must either be null or a function, not undefined
            at _inherits (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/bit-tabs/src/unstyled.js!eval:22:10)
            at eval (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/bit-tabs/src/unstyled.js!eval:80:5)
            at execute (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/bit-tabs/src/unstyled.js!eval:117:5)
            at doExecute (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/src/loader/loader.js:935:22)
            at ensureEvaluated (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/src/loader/loader.js:1000:11)
            at doEnsureEvaluated (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/src/loader/loader.js:963:15)
            at Loader.get (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/src/loader/loader.js:1114:7)
            at getModule (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:3189:24)
            at /Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:3237:16
            at execute (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:4107:28) onModuleExecution: true }
      (node:83509) UnhandledPromiseRejectionWarning: file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/mixin-props.js:9
        const realAddEventListener = Base.prototype.addEventListener;
                                          ^
      TypeError: Cannot read property 'prototype' of undefined
          at mixinDefine (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/mixin-props.js:9:36)
          at DeriveElement (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:66:8)
          at Object.<anonymous> (file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:107:44)
          at file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:109:4
          at file:/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/can-stache-element/src/can-stache-element.js:109:98
          at ContextifyScript.Script.runInThisContext (vm.js:50:33)
          at Object.runInThisContext (vm.js:139:38)
          at doEval (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:4788:10)
          at __eval (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:4892:7)
          at Loader.exec [as __exec] (/Users/josh/projects/bitovi/oss/donejs-chat/node_modules/steal/main.js:2896:5)<details>
    
  • I was using file:../some-dependency to include local dependencies... but this approach fell over with can-vdom because of (I think) a circular dependency. There are a couple more options (I hope to open an issue w/info on debugging SSR stuff... but I'm on client work now, so that may have to wait). Here are the other options:

    • Push prereleases. I guess this doesn't hurt anything, and is probably the most promising approach
    • Edit dependencies directly in node_modules/
      • pros
        • Can easily test changes
        • Can test changes locally
      • cons
        • Can loose track of changes
        • More difficult to base changes off a specific version (need to change package.json and reinstall rather than git checkout -b

@nlundquist
Copy link

nlundquist commented Dec 6, 2019

With the changes in these two PRs this branch is now SSR'ing without throwing errors, however the StacheElement is not rendering into the page.

canjs/can-simple-dom#97
canjs/can-vdom#70

@nlundquist
Copy link

nlundquist commented Dec 9, 2019

For whoever takes over for this issue I'll offer some guidance here:

  • you'll need to use some specific branches of some dependencies:
    • can-vdom#can6-upgrade
    • can-simple-dom#can6-compat
    • note: you'll need to make sure you use the same can-simpledom for that branch of can-vdom too. to accomplish this I recommend using the npm link command, but an alternative is using a file:// url for this dependency in the package.json files
  • node --inspect-brk node_modules/.bin/done-serve --develop --port 8080 is my preferred way of getting a debugger on the done-serve process
  • The next item of the work would be getting the connectedCallback handler of the registered custom elements to work, since that needs to happen for them to render. This handler should be run when an instance of that element is attached to a parent

If there's any other questions you have, please message me on Slack and I'll help however I can.

@MarcGodard
Copy link

I am requesting an improvement when you guys also upgrade donejs to use can6.0

Can you make donejs npx compatible?

https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b

Been using this on other projects without issue, but donejs doesn't seem to work with npx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants