Skip to content

Conversation

@mariuswilms
Copy link
Member

Building upon #140, I have our frontend now being build with esbuild and some Make, instead of using webpack and the tooling coming with CRA. This frees us from following CRA.

As with the CRA tooling make dev will also bring up a development server on port 3000, forwarding all API requests to a running backend instance on port 8080. The esbuild development server does not live reload, instead developers must refresh the browser which will cause a rebuild and reserver of the changed files.

We should probably merge this PR after user-components have been merged, as I had to use the jsx suffix for all files containing JSX. This might create a great amount of conflicts otherwise.

mariuswilms and others added 30 commits August 29, 2021 19:51
- Support the `-components` flag on `dsk`, to allow passing
  a path to a pre-build component bundle output directory.
- Provide playground handlers.
- Refactor `<Playground>`
- Use IFrame in Playground

Unrelated:

- Deprecate Node.components response property.
- Improve routing techniques, by using sub routers and allow
  us to extract route params.
- Rename flag variables.
- Pass more parent and current node into documentation components.
- Nodes now have an `id` that can be used to adress them. Although not
  from the outside.
Before, this generated the same Id for any component that had the same content no matter the tag or attributes, which leads to problems with empty components: <ColorCard color="#FF00000"></ColorCard> and <TableOfContents></TableOfContents> got the same Id. Adding the position to the string to be hashed ensures uniqueness.
@christophlocher
Copy link
Member

I would definitely prefer to get rid of the webpack config. I do like the live-reload a lot, but we could try without.

@mariuswilms I just renamed a lot of files in the user-components branch, so there will probably be a lot of conflicts. Sorry 😬 On the other hand I renamed them to .jsx

@mariuswilms
Copy link
Member Author

I've rebased this onto user-components, and can merge this once that branch is merged.

@mariuswilms
Copy link
Member Author

Test now don't pass but run. Please note that they don't pass as there is an issue in user-components that makes the tests fail. It should be adressed there.

@wegry
Copy link
Contributor

wegry commented Oct 14, 2021 via email

@mariuswilms
Copy link
Member Author

mariuswilms commented Oct 14, 2021

The back or front end? I’d gotten the front end running with react-scripts. We can just roll our own jest config though.

I stand corrected it's an issue introduced in this branch. I've removed support for objects (React nodes) as children of CodeBlock. You receive those when you use the component (not the markdown fenced code syntax) and don't use script tags to wrap the inner content. I removed support for that in this branch as it required React DOM Server which in turn requires additional shims when build through esbuild.

It's a feature we don't need anyway and can live without, since Christoph figured how to ensure we always receive unparsed string content in CodeBlock.

I'll be fixing that test here. When everything looks good and user-components is merged into 1.4 I'll squash/separate out commits in this branch and merge them into 1.4.

@mariuswilms
Copy link
Member Author

I've fixed the failing test in user-components, the commit that introduced the issue here belonged there. As user-components is where we got rid of the necessity of supporting react nodes in CodeBlock.

@mariuswilms
Copy link
Member Author

Last remaining bit here is fixing esbuild config to support data:image URLs in CSS, or finding a workaround for that.

@mariuswilms
Copy link
Member Author

Also fixed that, all done, waiting for user-components to merge, or additional reviews that block this PR.

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.

4 participants