Skip to content

Commit

Permalink
feat: Hash based id (#1440)
Browse files Browse the repository at this point in the history
* feature(macro): hash based id for js macro

* feature(macro): hash based id for jsx macro

* feature(): remove outdated code related to runtime context

* support hash based ids in po formatter

* test: add e2e test for extractor

* support context passed as tpl literal

* remove set/tz is outdated and causes test failures on windows

* update docs
  • Loading branch information
timofei-iatsenko authored Feb 22, 2023
1 parent 6b6adc9 commit 93ab9f4
Show file tree
Hide file tree
Showing 67 changed files with 2,128 additions and 1,315 deletions.
1 change: 0 additions & 1 deletion jest.config.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
testPathIgnorePatterns: ["/node_modules/"],
// Redirect imports to the compiled bundles
moduleNameMapper: {},
setupFiles: ["set-tz/utc"],

// Exclude the build output from transforms
transformIgnorePatterns: ["/node_modules/", "<rootDir>/packages/*/build/"],
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module.exports = {
}),

reporters: ["default", "jest-junit"],
setupFiles: ["set-tz/utc"],
setupFilesAfterEnv: [require.resolve("./scripts/jest/env.js")],
snapshotSerializers: [
"jest-serializer-html",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"rollup": "^3.10.0",
"rollup-plugin-dts": "^5.1.1",
"semver": "^7.3.2",
"set-tz": "^0.2.0",
"size-limit": "^8.1.1",
"strip-ansi": "^6.0.0",
"swc-node": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: {count, plural, one {# book} other {# books}},
message: undefined,
id: esnaQO,
message: {count, plural, one {# book} other {# books}},
origin: Array [
jsx-without-trans.js,
3,
Expand All @@ -125,8 +125,8 @@ Array [
Object {
comment: undefined,
context: Some context,
id: {count, plural, one {# book} other {# books}},
message: undefined,
id: 8qNz+K,
message: {count, plural, one {# book} other {# books}},
origin: Array [
jsx-without-trans.js,
4,
Expand All @@ -140,8 +140,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: Message,
message: undefined,
id: xDAtGP,
message: Message,
origin: Array [
js-with-macros.js,
3,
Expand All @@ -150,8 +150,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: Message,
message: undefined,
id: xDAtGP,
message: Message,
origin: Array [
js-with-macros.js,
5,
Expand All @@ -160,8 +160,8 @@ Array [
Object {
comment: description,
context: undefined,
id: Description,
message: undefined,
id: Nu4oKW,
message: Description,
origin: Array [
js-with-macros.js,
7,
Expand All @@ -180,8 +180,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: Values {param},
message: undefined,
id: QCVtWw,
message: Values {param},
origin: Array [
js-with-macros.js,
17,
Expand Down Expand Up @@ -245,8 +245,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: Hi, my name is {name},
message: undefined,
id: d1Kdl3,
message: Hi, my name is {name},
origin: Array [
jsx-with-macros.js,
3,
Expand All @@ -255,8 +255,8 @@ Array [
Object {
comment: undefined,
context: Context1,
id: Some message,
message: undefined,
id: YikuIL,
message: Some message,
origin: Array [
jsx-with-macros.js,
4,
Expand All @@ -265,8 +265,8 @@ Array [
Object {
comment: undefined,
context: Context1,
id: Some other message,
message: undefined,
id: LBCs5C,
message: Some other message,
origin: Array [
jsx-with-macros.js,
5,
Expand All @@ -275,8 +275,8 @@ Array [
Object {
comment: undefined,
context: Context2,
id: Some message,
message: undefined,
id: ru2rzr,
message: Some message,
origin: Array [
jsx-with-macros.js,
6,
Expand All @@ -285,8 +285,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: Title,
message: undefined,
id: MHrjPM,
message: Title,
origin: Array [
jsx-with-macros.js,
7,
Expand All @@ -295,8 +295,8 @@ Array [
Object {
comment: undefined,
context: undefined,
id: {count, plural, one {# book} other {# books}},
message: undefined,
id: esnaQO,
message: {count, plural, one {# book} other {# books}},
origin: Array [
jsx-with-macros.js,
9,
Expand Down
Loading

0 comments on commit 93ab9f4

Please sign in to comment.