Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Conversation

@PabloSzx
Copy link
Contributor

@PabloSzx PabloSzx commented Feb 3, 2022

currently getting this error: syntax-tree/unist#63

based on hashicorp/next-mdx-remote#211

I managed to fix all the errors except remark-admonitions https://github.com/elviswolcott/remark-admonitions, which stopped being maintained long ago, but graphql-codegen uses it a lot, that should be the only breaking thing by now (other than now requiring Next.js v12)

closes #465

@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2022

🦋 Changeset detected

Latest commit: e2ecc8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@guild-docs/client Major
guild-docs Major
@guild-docs/mdx-remote Major
@guild-docs/server Major
@guild-docs/types Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 3, 2022

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

🔍 Inspect: https://vercel.com/theguild/the-guild-docs/2oemtF1Wp9kYBHtYMSiQ8Rp1BLom
✅ Preview: https://the-guild-docs-git-mdx-v2-theguild.vercel.app

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 3, 2022

The latest changes of this PR are available as alpha in npm (based on the declared changesets):

@PabloSzx
Copy link
Contributor Author

PabloSzx commented Feb 5, 2022

@B2o5T I managed to fix most of the errors except remark-admonitions https://github.com/elviswolcott/remark-admonitions, which stopped being maintained long ago, but graphql-codegen uses it a lot, that should be the only breaking thing by now (other than requiring Next.js v12)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2022

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 566.77 KB (🟢 -982.8 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 2.18 KB (🔴 +1.61 KB) 568.95 KB
/_error 194 B (🟡 +1 B) 566.96 KB
/docs/[[...slug]] 9.79 KB (🔴 +9.33 KB) 576.56 KB
/mdx_component 1.08 KB (🔴 +803 B) 567.85 KB
/mdx_page 9.65 KB (🔴 +9.34 KB) 576.42 KB
/packages 4.89 KB (🟡 +756 B) 571.66 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.


import { css, Global } from '@emotion/react';
import RouterImport from 'next/router';
import RouterImport from 'next/router.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

why it's necessary? and other cases with index.js

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 part of esm, it's not new

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Next.js doesn't have explicit package exports, which means that deep imports need explicit extensions, it's just how it works

Copy link
Contributor Author

@PabloSzx PabloSzx Feb 8, 2022

Choose a reason for hiding this comment

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

test it yourself, remove the extensions, rebuild, and run node scripts/test-esm.mjs

Copy link
Contributor

@dimaMachina dimaMachina left a comment

Choose a reason for hiding this comment

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

Amazing work @PabloSzx, I approve and wrote some review changes.
Before we merge this we need to discuss what we'll do with remark-admonitions. cc @dotansimha

@charlypoly
Copy link
Contributor

@B2o5T do we plan to merge this soon?

The migration of the codegen doc can be quite easy by replacing remark-admonitions with custom components 🤓

* feat(client): add support for `mermaid-js`

Closes #502

* Create flat-bikes-attack.md

* Update .changeset/flat-bikes-attack.md

Co-authored-by: Saihajpreet Singh <[email protected]>

* some fixes

Co-authored-by: Saihajpreet Singh <[email protected]>
Co-authored-by: Dimitri POSTOLOV <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support last version of MDX

5 participants