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

WIP: hoist devDependencies and migrate to workspaces + rollup #2097

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

ThisIsMissEm
Copy link
Contributor

This is a highly experimental branch, where in I'm attempting to address some long standing issues with how we build the code in this repo. The commits are not minimal, there's a lot of cruft that needs to be cleaned up, but it's a first working version.

One note for Next.js: If you're using @inrupt/solid-ui-react and encounter an error when loading the SessionProvider (or other components), and the error is about window being undefined, well, it turns out that's kinda a next.js quirk that webpack was silently allowing to work somehow. We do need to "fix" the SDK to not make direct use of the window global object, but that's additional work that I'm trying to keep out of scope.

If you wanna test in next.js you'll need to do the following instead of just import { SessionProvider } from "@inrupt/solid-ui-react":

const SessionProvider = dynamic(
  () => import("@inrupt/solid-ui-react").then((mod) => mod.SessionProvider),
  {
    ssr: false,
  }
);

Additionally, there's some package json changes needed to properly tie it all together:

    // New dependency versions
    "@inrupt/solid-client-authn-browser": "1.11.9-alpha.5",
    "@inrupt/solid-ui-react": "^2.8.0-0795c00b",

  // Overriding the version of authn-browser in solid-ui-react:
"overrides": {
    "@inrupt/solid-ui-react@^2.8.0-0795c00b": {
      "@inrupt/solid-client-authn-core": "^1.11.9-alpha.5",
      "@inrupt/solid-client-authn-browser": "^1.11.9-alpha.5"
    }
  }

]
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0",
"webpack-merge": "^5.7.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Webpack is only used for the example apps now, but we can and probably should migrate to something else there (swc, next, rollup, etc)

},
"overrides": {
"@inrupt/eslint-config-base@0.4.0": {
"eslint-plugin-jest": "^26.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed until we publish @inrupt/eslint-config-base@1.0.0, as v0.4.0 / v0.4.1 do not use Jest 27

"license": "MIT",
"types": "dist/index",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pretty sure this was a bug

@ThisIsMissEm
Copy link
Contributor Author

@NSeydoux let's figure out a plan for the work that's been done here, most is already done elsewhere now, so really there's just the webpack -> rollup migration left.

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.

None yet

1 participant