-
Notifications
You must be signed in to change notification settings - Fork 133
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
Remove assert import for the plugin schema in favour of bundlers #1315
Conversation
Fixes decentralized-identity#1254 Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## next #1315 +/- ##
===========================================
- Coverage 85.50% 68.18% -17.33%
===========================================
Files 170 176 +6
Lines 18946 26993 +8047
Branches 2115 2116 +1
===========================================
+ Hits 16200 18405 +2205
- Misses 2746 8588 +5842 ☔ View full report in Codecov by Sentry. |
Btw it's not only a webpack problem, but also for esbuild and babel. For babel there is a plugin that can deal with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
Since these are generated files, they will get updated as the plugin schemas change (even when updating inline docs) so it will lead to ugly diffs and conflicts.
I think we shouldn't care about having the outputs minified (or in our case not formatted) since that's a task for bundlers.
Also, this will get merged into next
which is scheduled for a release soon including other breaking changes that will trigger a major version bump so I would opt for removing the JSON files completely
So should we remove the json files from this PR and merge it when it fits for the major version? |
Yes, please remove them. We don't have an ability to mark them as deprecated, but if anyone depends on them they'll see a broken build after upgrading to the new major version and they'll be able to roll back their upgrade. |
Fixes decentralized-identity#1254 Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Done |
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
Thank you for posting these changes.
@mirceanis I am not quite sure if |
I agree. Please post a PR if you're already testing this out |
What issue is this PR fixing
Fixes #1254
What is being changed
As described in the issue I replaced the
assert { type: 'json' }
with a classic typescript import. This allows other bundlers like webpack to deal with this without throwing an error since the assert command is not fully supported by typescript yetI also stored the plugin.json file as non formatted, saving around 50% of the size.
There are still some assert imports in the
ld-default-context
package, this can be handled in another issue since it has nothing to do with this task of generating the schema of a plugin.The
plugin.schema.ts
is generated in parallel to theplugin.schema.json
so it does not break other project that are depending on them.Quality
Check all that apply:
pnpm i
,pnpm build
,pnpm test
,pnpm test:browser
locally.