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

Pin package dependencies, remove CRWA template yarn.lock, set up Yarn offline cache #2637

Merged
merged 11 commits into from
May 28, 2021

Conversation

thedavidprice
Copy link
Contributor

@thedavidprice thedavidprice commented May 26, 2021

Per Core Team discussion, I made the following changes in an attempt to improve dependency stability across packages:

  • pin all dependencies versions
  • remove create-redwood-app/template/yarn.lock
  • set up Yarn offline cache; add dependency tgz files to repo (moving to separate PR set up yarn offline cache #2669)
  • adds '@babel/plugin-proposal-nullish-coalescing-operator' to babel.config and core/config/babel-preset
    • look into removing in Webpack 5 PR
  • fixes FetchConfigProvider (which were apparently hidden previously)
  • Deprecate authToken from AuthContext

@thedavidprice
Copy link
Contributor Author

thedavidprice commented May 26, 2021

UPDATE: solved with nhost package update. And, yes, it was an error hidden by yarn.lock I believe.

Wow, not at all understanding how I'm encountering this TS build error:

packages/auth/src/authClients/nhost.ts:80:9 - error TS2345: Argument of type '{ email: any; password: any; options: { userData: { display_name: any; }; }; }' is not assignable to parameter of type 'registerCredentials'.
  Object literal may only specify known properties, and 'options' does not exist in type 'registerCredentials'.

80         options: { userData: { display_name: email } },

Has it been there all along and we've just missed it due to dependency version resolutions? That's the only thing I've changed in this PR.

@thedavidprice thedavidprice added this to the next-release milestone May 26, 2021
@cypress
Copy link

cypress bot commented May 26, 2021



Test summary

17 0 0 0Flakiness 1


Run details

Project RedwoodJS Framework
Status Passed
Commit c9dd80d ℹ️
Started May 28, 2021 5:30 PM
Ended May 28, 2021 5:40 PM
Duration 09:51 💡
OS Linux Ubuntu - 20.04
Browser Chrome 90

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@thedavidprice
Copy link
Contributor Author

thedavidprice commented May 26, 2021

@dac09 I believe I've tracked down the Babel error, which is:

../redwood/web/dist/components/FetchConfigProvider.js 29:40
Module parse failed: Unexpected token (29:40)
File was processed with these loaders:
 * ../node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| 
| const FetchConfigProvider = ({
>   useAuth = global.__REDWOOD__USE_AUTH ?? (() => ({
|     loading: false,
|     isAuthenticated: false

It's coming from the transpiled file redwood/web/dist/components/FetchConfigProvider.js. It's throwing the error on the ?? operator, which seems strange to me. If I modify the file directly like this, indeed I resolve the issue:

useAuth = global.__REDWOOD__USE_AUTH ? global.__REDWOOD__USE_AUTH : (() => ({

The source code is here:

export const FetchConfigProvider: React.FunctionComponent<{
useAuth?: () => AuthContextInterface
}> = ({
useAuth = global.__REDWOOD__USE_AUTH ??
(() => ({ loading: false, isAuthenticated: false })),
...rest
}) => {
const { isAuthenticated, authToken, type } = useAuth()

So I attempted to use different syntax/conditional here; however, I run into TS errors for AuthContextInterface. What I think is going on is that the conditional logic for the case !global.__REDWOOD__USE_AUTH results in invalid TS for useAuth() —> authToken, type specifically.

Assuming I'm correct, I need your help resolving.

Update: I was not correct...

@thedavidprice thedavidprice added the release:breaking This PR is a breaking change label May 28, 2021
@thedavidprice thedavidprice merged commit 9153749 into main May 28, 2021
@thedavidprice thedavidprice deleted the dsp-pin-dependencies-yarn-cache branch May 28, 2021 18:42
dac09 added a commit to dac09/redwood that referenced this pull request Jun 2, 2021
…s-ts

# By David Price (6) and others
# Via GitHub
* 'main' of github.com:redwoodjs/redwood:
  build(deps): bump ts-morph from 10.1.0 to 11.0.0 (redwoodjs#2656)
  build(deps): bump core-js from 3.12.1 to 3.13.1 (redwoodjs#2680)
  bump react types and eslint packages patch version (redwoodjs#2695)
  build(deps): bump esbuild from 0.12.1 to 0.12.5 (redwoodjs#2654)
  upgrade misc packages with patch (redwoodjs#2694)
  Fix lerna canary publishing; use default --canary versioning with `git describe` (redwoodjs#2693)
  Upgrade axios due to security alert. (redwoodjs#2688)
  add esbuild config to CLI build and dev (redwoodjs#2564)
  set up yarn offline cache (redwoodjs#2669)
  Create file watch for type def generation (redwoodjs#2614)
  Pin package dependencies, remove CRWA template yarn.lock, set up Yarn offline cache (redwoodjs#2637)
  Fix serve tests (redwoodjs#2668)

# Conflicts:
#	packages/cli/src/commands/generate/types/types.js
#	packages/internal/src/generate/generate-project-typedefs.js
#	packages/internal/src/generate/helpers.js
#	packages/internal/src/generate/templates/scenarios.d.ts.template
dac09 added a commit to dac09/redwood that referenced this pull request Jun 2, 2021
…ter-tests

* 'main' of github.com:redwoodjs/redwood:
  downgrade jest-watch-typeahead 0.6.3 (redwoodjs#2699)
  Exclude yarn packages cache. (redwoodjs#2697)
  build(deps): bump ts-morph from 10.1.0 to 11.0.0 (redwoodjs#2656)
  build(deps): bump core-js from 3.12.1 to 3.13.1 (redwoodjs#2680)
  bump react types and eslint packages patch version (redwoodjs#2695)
  build(deps): bump esbuild from 0.12.1 to 0.12.5 (redwoodjs#2654)
  upgrade misc packages with patch (redwoodjs#2694)
  Fix lerna canary publishing; use default --canary versioning with `git describe` (redwoodjs#2693)
  Upgrade axios due to security alert. (redwoodjs#2688)
  add esbuild config to CLI build and dev (redwoodjs#2564)
  set up yarn offline cache (redwoodjs#2669)
  Create file watch for type def generation (redwoodjs#2614)
  Pin package dependencies, remove CRWA template yarn.lock, set up Yarn offline cache (redwoodjs#2637)
  Fix serve tests (redwoodjs#2668)
  Add script to create a functional test project using the latest CRWA template (redwoodjs#2324)
  build(deps): bump @typescript-eslint/eslint-plugin from 4.24.0 to 4.25.0 (redwoodjs#2627)
  Manage history state length exploding if clicking on a link with with the current route location (redwoodjs#2616)
  [forms] Fix number validation msg (redwoodjs#2552)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants